I have an event trigger that I want to be fired in response to two different routed events. I don’t want to repeat the event response code (in XAML) twice. Can I specify multiple routed events for a single event trigger declaration?
Example of a single event:
<Style.Triggers> <EventTrigger RoutedEvent='Button.MouseEnter'> <--XAML MAGIC--> ...
Sorry… WPF’s implementation of the EventTrigger only allows one routed event.
Typically you would be firing a storyboard from a routed event. I would suggest the following compromise:
The concept is to reduce duplicate code by sharing resources.
Hope this helps!