This is a migrated thread and some comments may be shown as answers.

Context Menu and selected item command

0 Answers 78 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Justin Lee
Top achievements
Rank 1
Justin Lee asked on 28 Dec 2012, 05:22 PM
I'm using a TreeView and mvvm.  I want the selection of a node to fire a command, and I also want to add a context menu to the tree items. 

I added a ContainerBinding to wire up the selection command. -- this works fine.
I added a ContextMenu to the treeview -- this works fine (by itself)

However, after adding both of them -- when you right click on a not-selected item, and select one of the menu items, the underlying node gets selected immediately after.  The end result is 2 commands get fired. (instead of just the menu item command)

So my question is: is there a way to have context menu item click NOT select the node (and fire the selection command)?

Thanks,
Justin
Tags
TreeView
Asked by
Justin Lee
Top achievements
Rank 1
Share this question
or