I have a TreeView with a ContextMenu with Click events. When the click event in the context menu fires, I get the MenuItem as the source of the event, obviously. How can I get which node in the TreeView was the one who triggered the ContextMenu?
Share
Generally you store the TreeView node (e.g. the source of the pop-up event, maybe the selected node – depends on your interface to some degree) in a private class-level variable in the ContextMenu’s ‘pop-up’ event, then refer to that variable in the menu’s click event.