Hi everyone,
There are a lot of discussions about M-V-VM and Command binding (RelayCommand) but not a lot has been covered on Routed Events binding to a handler in a M-V-VM pattern. I want to find what is the best approach.
Here is an example of RoutedEvent binding using a custom event and a bound event handler to the VM.
<Navigation:LeftNavigation x:Name="_leftNav" Margin="3"
BindingHelper:EventHelper.RoutedEvent="Events:Customer.SelectionChanged"
BindingHelper:EventHelper.EventHandler="{Binding SelectionChanged}" />
In my Vm, I would have an event handler similar to this.
public void SelectionChanged(object sender, CustomerSelectionChangedArgs e)
{
// Do something
}
This is only a concept taken from many examples from command binding. How would I get this to work for routed events.