Solved

WPF: How to make wpf shapes clickable!

Posted on 2014-11-05
1
300 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
1 Comment
 
LVL 14

Accepted Solution

by:
Tchuki earned 500 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now