I know I can force reevalution of CanExecute in the view model, however, this requires the view model to register to all related data change events, which might not be always feasible.
Since the commands are only used in the context menu, and during the context menu is open, the data that affect CanExecute cannot be changed, it would be sufficient if CanExecute is reevaluated only when context menu is being opened.
To do this, I can hook up context menu open event and call view model to call RaiseCanExecuteChanged on each ICommand the context menu uses, but it's tedious and anti MVVM. I am wondering if there is an easier way to achieve this?