Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# XAML
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 21:02pm
Edited 9-Jan-12 21:04pm
v2
Rate this: bad
good
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[^].
  Permalink  
Comments
SAKryukov at 10-Jan-12 3:03am
   
Makes sense, a 5.
--SA
Abhinav S at 10-Jan-12 3:12am
   
Thank you SA.
Rate this: bad
good
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.
 
—SA
  Permalink  

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

  Print Answers RSS
0 Zoltán Zörgő 200
1 Sergey Alexandrovich Kryukov 160
2 Peter Leow 90
3 Ramza360 51
4 Arkadeep De 50
0 Zoltán Zörgő 80
1 the other paul 23
2 Shmuel Zang 10
3 Aarti Meswania 5
4 Member 11389991 -2


Advertise | Privacy | Mobile
Web02 | 2.8.150129.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2015
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