When I left click on a TreeView
, it automatically selects the item under mouse. How can I do this for right click so when you right click, it also selects the item under mouse?
I want to do this because when I right click, I set the context menu of the TreeView
when the SelectedItem
changes, based on the e.NewValue
of TreeView_SelectedItemChanged
. But the right click itself doesn't change the SelectedItem
, that's why the wrong menu shows up. Or I have to first left click to the item I want selected, and then right click.
Any ideas on how to do this?