Ok,
I have a treeview that is LoadOnDemand. I have a HierarchicalDataTemplate and within it I define a RadContextMenu.
Currently, I am setting the ItemClicked event handler and calling the ViewModel from code behind. It all works, but I know I am being a bad boy calling the viewmodel from the codebehind.
Here's what I'd like to do:
Somehow, bind a command to the HierachicalDataTemplate so that I have a single function that receives all context menu clicks via a command. I should be able to sort out which context menu item was clicked in the command parameter (I think).
I have tried adding an EventToCommandBehavior to the HierachicalDataTemplate, but the compiler whines that nested properties are not supported.
I get this because I am already using EventToCommandBehavior in the treeview itself.
It seems that putting an additional EventToCommandBehavior in the HierarchicalDataTemplate is a no-go.
How can I receive commands from context menus generated in a loadondemand treeview and have it be MVVM friendly?
Thanks ... Ed