Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Patch available: Automatically call RaiseCanExecuteChanged() when CommandParameter changes

$
0
0
Running into the same problem. I'm not sure I understand this architecture. I have some generic commands (Open, Close, Properties) associated with MenuItem commands in a ContextMenu. I'm using the CompositeCommand pattern of PRISM to implement. So that I don't have to create 1,000 different ContextMenus on the line items I show in my grid, I just create a single ContextMenu and use the DataContext of each of the line items to provide a context for the ContextMenu. However, when I change the CommandParameter on the menu item to be the new DataContext of the current line item, the CanExecuteChanged event is not invoked. What am I missing here? How do you construct a complex, multi-module application if you need access to the DelegateCommand of every command you create?

Viewing all articles
Browse latest Browse all 1878

Trending Articles