Reputation: 1962
I have a button that needs to execute two separate commands (one to start something and one to stop it). After doing some research the System.Windows.Interactivity.dll seemed to provide an easy way to accomplish this. But it doesn't work with the left mouse button (it does work if I use an event like MouseDoubleClick or MouseRightButtonDown, but not MouseDown, MouseUp, or MouseRightButtonDown)...it seems as if the button consumes the event itself and the interaction.trigger never sees it. I provided a snippet of my XAML below, what can I do to get around this behavior?
<Button Content="DoStuff">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDown">
<i:InvokeCommandAction Command="{Binding StartCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="MouseUp">
<i:InvokeCommandAction Command="{Binding StopCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
Upvotes: 4
Views: 8210