I'm using Microsoft.Toolkit.MVVM, in doc we can use binding Button command like:
<Button Content="Click me!" Command="{Binding ButtonClickCommand}"/> But for ListView, I have to write like with Behaviors, this code is to long:
<ListView> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged"> <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True"/> </i:EventTrigger> </i:Interaction.Triggers> </ListView> So why can't use below code instead? This is simple, but not working.
<ListView SelectionChanged={Binding SelectionChangedCommand}/>
Commandproperty is ofICommandtype, but theSelectionChangedproperty should be matched with an Event Handler.