I'm working in the MVVM design pattern with WPF. I have a ContextMenu
with several items in it on a ListView
. Based on the number of items selected in the ListView
, I want to enable/disable certain MenuItem
s. Is there a way to route the SelectionChanged
event along with the number of selected items in the ListView
directly to the view model. If so, I can define a dependency property in the VM for IsEnabled
quite easily. I'm just trying to avoid code-behind to handle this.
Kelly