我对Mvvlight的RelayCommand
和EventToCommand
有点困惑。 看来EventToCommand
处理EventTrigger
并呼吁RelayCommand
做工作。 如:RelayCommand vs EventToCommand
<i:Interaction.Triggers>
<i:EventTrigger x:Uid="i:EventTrigger_1" EventName="MouseLeftButtonUp">
<cmd:EventToCommand x:Uid="cmd:EventToCommand_1" Command="{Binding Form_MouseLeftButtonUpCommand}" PassEventArgsToCommand="True"/>
</i:EventTrigger>
</i:Interaction.Triggers>
我的理解是否正确?
那么,我们可以直接使用RelayCommand
与EventTrigger
,不需要使用EventToCommand
?
感谢您的帮助!