我正在关注以下讨论, 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?
谢谢。
答案 0 :(得分:1)
根据我的理解,多个事件绑定将起作用并且不建议使用。