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 20:02pm
Edited 9-Jan-12 20: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 Kornfeld Eliyahu Peter 430
1 OriginalGriff 299
2 Nelek 115
3 Sergey Alexandrovich Kryukov 99
4 Gihan Liyanage 99
0 Kornfeld Eliyahu Peter 420
1 OriginalGriff 140
2 Gihan Liyanage 99
3 Nelek 65
4 sankarsan parida 65


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2014
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