【发布时间】:2013-01-02 04:03:10
【问题描述】:
我对 Mvvmlight 中的 RelayCommand 和 EventToCommand 有点困惑。
似乎EventToCommand 处理EventTrigger 并调用RelayCommand 来完成工作。
如:
<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吗?
感谢您的帮助!
【问题讨论】:
标签: c# wpf mvvm mvvm-light routed-commands