【发布时间】:2014-03-18 15:21:25
【问题描述】:
RightMouseDownEvent 是否可以与 EventToCommand 一起使用?
我可以将命令与 PreviewMouseRightUp 和 PreviewMouseRightDown 绑定,但 MouseRightButtonDown 什么也不做。我是否使用了错误的事件名称——就这么简单吗?
在 xaml 中——我将两个事件绑定到同一个处理程序——只有一个有效(预览...向上)。我依次注释掉每个,但只有预览有效。
想法?谢谢!
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand Command="{Binding SetActivePaneCommand}" CommandParameter="{Binding PaneOne}" PassEventArgsToCommand="False" />
<cmd:EventToCommand Command="{Binding ListSelectionChangedCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger>
<i:EventTrigger EventName="MouseRightButtonDown">
<cmd:EventToCommand Command="{Binding PreviewMouseRightButtonUpCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseRightButtonUp">
<cmd:EventToCommand Command="{Binding PreviewMouseRightButtonUpCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
【问题讨论】:
标签: wpf xaml mvvm-light eventtocommand