I want to create context menu item collection that each one of the item have header, command, can execute command and also to add a new feature for visibility that is also function like 'canExecute' but with other condition.
When i'm pressing on a row in my DataGrid
I want to create a new context menu that have collection context menu item that bounded to the context menu items source(ItemContainerStyle
).
I want to execute 2 function on each menu item:
CanExecute
- for disable/enable to itemCanSee
- for changing the visibility of the context menu item in case that it is not relevant to item.
What is the best way to do it?