1

In WPF, is it possible to make an "event trigger story" based on the events that are fired?

In my concrete example, I want an event trigger that triggers on a button's mouse enter event. Then, I want a click event trigger OR a mouse leave event trigger. That is, if the user clicked the button, mouse leave event should not be triggered.

Is this possible with normal event triggers, or am I looking in the wrong place?

EDIT:

What I'm doing is that when the user clicks the button, I start the animation. However, the mouse leave event animates the same control/property so it "overrides" the on-going "click animation" if the user moves out of the button while the "click animation" is running.

Kristoffer Lindvall
  • 2,674
  • 1
  • 18
  • 27

1 Answers1

1

This is a good opportunity for a Multitrigger. Here is a good example of achieving an "OR" condition with triggers.

robowahoo
  • 1,259
  • 9
  • 10
  • Not quite what I'm looking for. After some more thinking, what I'm really looking for is some way of queuing animations when events are triggered on the controller. – Kristoffer Lindvall Nov 02 '11 at 11:42
  • What about something like http://stackoverflow.com/questions/1511870/wpf-sequential-animation-simple-example to sequentially animate? Add a method that is triggered by your "OR" Multitrigger. If this is the "first" event, you start the animation and store it as the "current". When the next event is triggered you check if an animation is already in progress. If so, attach the new animation to the Animation.Completed event as described in the previous answer. – robowahoo Nov 02 '11 at 14:05