在WPF中处理MVVM中的多个鼠标事件

时间:2019-02-18 10:17:23

标签: mvvm mouseevent

我正在关注以下讨论, Handling Mouse Events in MVVM in WPF 它适用于一个事件,但是当我尝试多个事件时,它不起作用。

I want to bind multiple events like below:

<i:Interaction.Triggers>
      <i:EventTrigger 
     EventName="PreviewMouseLeftButtonDown">
     <i:InvokeCommandAction Command="{Binding TripLegCopyIconPressedCommand}"/>
      </i:EventTrigger>
     <i:EventTrigger EventName="PreviewMouseLeftButtonUp">
     <i:InvokeCommandAction Command="{Binding 
               TripLegPreviewMouseLeftButtonUpCommand}"/>
      </i:EventTrigger>
    </i:Interaction.Triggers>

But it is not working. How to do that? Any idea?

谢谢。

1 个答案:

答案 0 :(得分:1)

根据我的理解,多个事件绑定将起作用并且不建议使用。

相关问题