Solved

WPF: How to make wpf shapes clickable!

Posted on 2014-11-05
1
353 Views
Last Modified: 2015-01-20
Hi!

I have a pdf with a building  floorplan (very large building) and i would like to create the floorplan in xaml and then make every room clickable so that users may get info about the room!
what would be the best way to do it? and what tools to use for creating the xaml?

i work in visual studio normally.

a code sample would be great!

/J
0
Comment
Question by:jamppi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
Vel Eous earned 500 total points
ID: 40431112
Depending on the complexity of the shapes involved, you may wish to consider the Path tool, you could also use the Tooltip rather than a button to display information when someone hovers over the shape (just a suggestion):

<Grid>
    <Path Stroke="Blue" Fill="Red"
            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
            Margin="0" Width="100" Height="100" x:Name="Path"
            Stretch="Fill"
            Data="M8.660254,0 L17.320508,5 17.320508,15 8.660254,20 0,15 0,5 8.660254,0 z">
        <Path.ToolTip>
            <TextBlock Text="Description" />
        </Path.ToolTip>
    </Path>
</Grid>

Open in new window

0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question