Partager via


IXREventTrigger (Windows Embedded CE 6.0)

1/6/2010

This class represents a trigger that applies a set of actions, also known as animation storyboards, in response to an event.

Syntax

class IXREventTrigger : public IXRTriggerBase

Methods

Method Description

IXREventTrigger::GetActions

Retrieves the collection of IXRBeginStoryboard objects that this object triggers.

IXREventTrigger::GetRoutedEvent

Retrieves the name of the event that initiates the trigger.

IXREventTrigger::SetRoutedEvent

Sets the name of the event that initiates the trigger.

Remarks

Although this class is available to you, we recommend that you instead add storyboard animations to the IXRResourceDictionary collection that belongs to an IXRFrameworkElement derived object. Use IXRFrameworkElement::GetResources to retrieve this collection of objects. Then, assign an event handler to the event that you want to trigger an animation storyboard. The event handler will respond to the relevant event by retrieving the storyboard from the resource collection and then calling IXRStoryboard::Begin.

Notice that the collection of triggers retrieved by IXRFrameworkElement::GetTriggers can only contain IXREventTriggers that support the Loaded event. You can also produce the same behavior by creating a handler for the Loaded event that calls the Begin method and then calling IXRFrameworkElement::AddLoadedEventHandler to attach its delegate to Loaded. However, using the event handler to start the storyboard is a more versatile coding pattern. You can also change or reuse the event handler to respond to a different event, such as MouseEnter.

You can also define an event trigger in Microsoft Silverlight 2 XAML. For information about the differences between XAML in Silverlight for Windows Embedded and Silverlight 2, see Differences Between Silverlight for the Web and Silverlight for Windows Embedded. For more information about how to define this element in the source XAML for your application, see this Microsoft Web site.

Inheritance Hierarchy

IXRDependencyObject

    IXRTriggerBase

        IXREventTrigger

.NET Framework Equivalent

System.Windows.EventTrigger

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

Classes for Visual Appearance and Behavior
IXRTriggerCollection