Solved

WPF: How to make wpf shapes clickable!

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

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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