Click here to Skip to main content
13,458,506 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm making a WPF application for drawing graph and generating xml for dat graph.
I have a list of blocks in a toolbox. these blocks are dragged into a canvas at runtime. when I right click on a dragged block, I need to open a new window depending on the block clicked. fr dat, hw can I know whic block is clicked..

thanks in advance..
Posted 9-Jan-12 20:02pm
Updated 9-Jan-12 20:04pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you can understand Routed Events, then will able to figure out the exact control the click is coming from - go through this[^].
SAKryukov 10-Jan-12 3:03am
Makes sense, a 5.
Abhinav S 10-Jan-12 3:12am
Thank you SA.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

This is a wrong approach. Instead, you should directly handle a click on the element you want to handle and ignore others.

The question is just the result of anti-OOP and anti-event-oriented thinking, which should be fixed.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03-2016 | 2.8.180323.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100