Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
How to determine the XamTreeItem clicked?
posted

I have a WrapPanel that contains 5 XamTrees.  I want to be able to get a reference to the XamTreeItem that was clicked.

My first attempt was to set a MouseLeftButtonUp event handler on the WrapPanel and use e.OriginalSource to get the reference to the XamTreeItem.  But, instead, e.OriginalSource returned the TextBlock associated with the XamTreeItem.

Am I going to have to programmatically subscribe to the event for each and every XamTreeItem?  Or, is there a more elegant and efficient way to handle thie?