EventTrigger.Actions Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the collection of actions to apply when the event occurs.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

Public ReadOnly Property Actions As TriggerActionCollection

Property Value

Type: System.Windows.TriggerActionCollection

The default is an empty collection.

Unlike Trigger, EventTrigger has no concept of termination of state, so the action will not be undone once the condition that raised the event is no longer true.

Adding a TriggerAction child to an EventTrigger object implicitly adds it to the TriggerActionCollection for the EventTrigger object.

System_CAPS_noteNote

This property can only be set in Extensible Application Markup Language (XAML) via the collection syntax shown, or by accessing the collection object and using its various methods such as Add. The property to access the collection object itself is read-only, the collection itself is read-write.

<object>
  <object.Actions>
    OneOrMoreTriggerActions
  </object.Actions>
</object>

OneOrMoreTriggerActions

One or more TriggerAction objects.

This example describes how to use event triggers in a style to animate the MouseEnter and MouseLeave events of a FrameworkElement. As mentioned above, adding a TriggerAction child to an EventTrigger object implicitly adds it to the TriggerActionCollection for the EventTrigger object. Therefore, in this example, <EventTrigger.Actions> is implicit.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: