Gets or sets the RoutedEvent that will activate this trigger.
Assembly: PresentationFramework (in PresentationFramework.dll)
EventTriggers apply a set of actions when the specified occurs. For example, you may want to use EventTriggers to start a set of animations when the mouse pointer is over a certain user interface (UI) control.GTMT
If the template or style that contains this EventTrigger does not have the TargetType property specified, then you need to quality the event name with the class name using the ClassName.EventName syntax.
EventTrigger objects cannot handle events that have already been Handled. Controls such as Button or TextBox perform specific actions on user input events such as mouse clicks and keyboard events. For example, if you are styling a button and try to set the MouseDown event as the of an EventTrigger, the EventTrigger never gets applied because the event first gets handled by the button. Instead, you can use the PreviewMouseDown event or a different event.
Legacy Code Example
This example shows how to use event triggers in a style to animate the MouseEnter and MouseLeave events of a FrameworkElement. In this example, the Style has the TargetType set to Rectangle. Therefore, there is no need to qualify the MouseEnter and MouseLeave event names with the class name.Code snippet is not found. Confirm that the code snippet name 'StyleEventTriggerAnimation' is correct.Code snippet is not found. Confirm that the code snippet name 'HOWDOI' is correct.
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0