I have a TreeView control which is data bound to hierarchical data source. I have defined a context menu for the TreeView and using s style have attached an PreviewMouseRightButtonDown event handler to each TreeViewItem which modified the context menu depending
on the nature of the TreeViewItem. I also have event handlers for each of the buttons within the ContextMenu.
When I right click on an item, the correct context menu appears and click on an button triggers the expected event handler for the button. The context menu however remains until I clcik outside of the content menu.
View Complete Post