wpf - How to determine which node was clicked. Silverlight treeview -


To determine which node was clicked on? Treviewview from Silverlight Toolkit

I need to get a node in the mouse arrow button:

Private Zero TreeViewMaharashtra ButtonsUp (Object Sender, Mouse Button Avenger Eergus E)

Class = "post-text" itemprop = "text">

MouseButtonEventArgs has a OriginalSource property that points to the actual UIElement The incident which occurs.

To find out which node you have related element, you will need to cross the visual tree to find it. I use this extension method to help with it: -

  public static IEnumerable & lt; DependencyObject & gt; Ancestors (this dependency object root) {dependent object current = visualtrayhelper. Gatepant (root); While (current! = Null) {yield returns current; Current = VisualTripleGatePecure (current); }}  

Then in the MouseRightButtonUp event, you can use this code to search for items: -

  TreeViewItem Node = ((dependent object) e.OriginalSource). Ancestors () Off type & lieutenant; Tree whitem & gt; () .FirstOrDefault ();  

Comments