I have a view with a grid of data, where multiple rows can be selected.
I also have a DelegateCommand in my VM that I need to enable if only one row is selected. If user selects multiple rows, it should be disabled. The command is bound in 2 places - the main view with the grid as a context menu option, and another view - the
ribbon button group
The problem is that the information about the currently selected rows is part of the main view, not the view model or the ribbon.
I'm thinking I need handle the grid's SelectionChanged event inside the view's codebehind and then somehow signal the VM which rows have been selected. The VM would enable/disable the command. This would in turn enable/disable the context menu and the ribbon
I'm wondering if there is an easier or a more unified/universal way of accomplishing it.