dynamic ContextMenu in TreeView vs. MVVM

Posted by bitbonk on Stack Overflow See other posts from Stack Overflow or by bitbonk
Published on 2010-03-24T14:17:31Z Indexed on 2010/03/25 4:13 UTC
Read the original article Hit count: 899

Filed under:
|
|
|

I have a tree of ViewModels displayed as a TreeView (using HierarchicalDataTemplate). Each ViewModel instance has different commands that can be executed on it wich again are exposed as a list of command ViewModels for each item ViewModel. How can I create a single ContextMenu that opens at the TreeViewItem that was rightclicked and that populates its commands from the underlying item ViewModel's command ViewModels list? All in a decent MVVM fashion ...

© Stack Overflow or respective owner

Related posts about mvvm

Related posts about wpf