Compartir a través de


IXRTriggerCollection (Compact 2013)

3/28/2014

This class represents a collection of IXRTriggerBase objects.

Syntax

class IXRTriggerCollection : public IXRDependencyObject

Inheritance Hierarchy

IXRDependencyObject

    IXRTriggerCollection

Methods

Method

Description

IXRTriggerCollection::Add

Adds an item to the end of this collection and retrieves the index of where it was added.

IXRTriggerCollection::Clear

Removes all items from this collection.

IXRTriggerCollection::Contains

Determines whether an item is in this collection.

IXRTriggerCollection::GetCount

Retrieves the number of items in this collection.

IXRTriggerCollection::GetItem

Retrieves the item at the specified index in this collection.

IXRTriggerCollection::IndexOf

Searches for the specified item and retrieves the zero-based index of its last occurrence within this collection.

IXRTriggerCollection::Insert

Inserts an item into this collection at the location with the specified index value.

IXRTriggerCollection::Remove

Removes a specific item from this collection.

IXRTriggerCollection::RemoveAt

Removes the item at the specified index from this collection.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

An event trigger is the mechanism by which an event triggers an animated change in a property value. The IXRTriggerCollection class contains a collection of event triggers that support only the Loaded event. Event triggers apply a set of animation storyboards to an object. The storyboards run when the object's Loaded event occurs.

Note

If you need to trigger storyboard animations when events other than the Loaded event occur, you can use the alternative method described in IXREventTrigger. You can also create different visual states for an object and programmatically change state when events occur. For more information, see IXRVisualState.

You can obtain a trigger collection for a framework element that was defined in the source XAML by calling IXRFrameworkElement::GetTriggers.

You can remove items from the existing collection by using the IXRTriggerCollection::Remove or IXRTriggerCollection::RemoveAt methods. To access items in the existing collection, call the IXRTriggerCollection::GetItem method. To clear the complete collection, call the IXRTriggerCollection::Clear method.

When you create a class instance, use an IXRTriggerCollectionPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can define a trigger collection in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the FrameworkElement::Triggers Property on MSDN.

.NET Framework Equivalent

System.Windows.TriggerCollection

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Collection Management
IXRFrameworkElement::GetTriggers