Solved

WPF: How to make wpf shapes clickable!

Posted on 2014-11-05
1
305 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

22 Experts available now in Live!

Get 1:1 Help Now