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
Solved

WPF: How to make wpf shapes clickable!

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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