Context Menu and selected item command

1 posts, 0 answers
  1. Justin Lee
    Justin Lee avatar
    146 posts
    Member since:
    Dec 2009

    Posted 28 Dec 2012 Link to this post

    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)?

Back to Top