Compartilhar via


IXRVisualTransitionCollection (Compact 2013)

3/28/2014

This class represents a collection of IXRVisualTransition objects that define visual behavior for state transitions for an IXRUserControl object.

Syntax

class IXRVisualTransitionCollection : public IXRDependencyObject

Inheritance Hierarchy

IXRDependencyObject

    IXRVisualTransitionCollection

Methods

Method

Description

IXRVisualTransitionCollection::Add

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

IXRVisualTransitionCollection::Clear

Removes all items from this collection.

IXRVisualTransitionCollection::Contains

Determines whether an item is in this collection.

IXRVisualTransitionCollection::GetCount

Retrieves the number of items in this collection.

IXRVisualTransitionCollection::GetItem

Retrieves the item at the specified index in this collection.

IXRVisualTransitionCollection::IndexOf

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

IXRVisualTransitionCollection::Insert

Inserts an item into this collection at the specified index.

IXRVisualTransitionCollection::Remove

Removes a specific item from this collection.

IXRVisualTransitionCollection::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

Do the following to create a new collection of visual transitions for an IXRUserControl object:

  1. Use the IXRApplication::CreateObject(IID,Object) method to create an empty IXRVisualTransitionCollection object.
  2. Use CreateObject to create multiple IXRVisualTransition objects that each define the visual appearance for a state of a control.
  3. Add each IXRVisualTransition object to the IXRVisualTransitionCollection collection by calling the IXRVisualTransitionCollection::Add method.
  4. Set the new collection for an IXRVisualStateGroup by calling IXRVisualStateGroup::SetTransitions.

This IXRVisualStateGroup object must belong to an IXRVisualStateGroupCollection. You can create a new collection and add the new IXRVisualStateGroup to it.

To set a new collection of IXRVisualTransition objects for an IXRUserControl object at run time, retrieve the element that is the content of an IXRUserControl. Obtain this element by calling IXRUserControl::GetContent. Then, call IXRDependencyObject::SetAttachedProperty(const WCHAR*, const WCHAR*, IXRDependencyObject*) on that element to set the IXRVisualStateGroupCollection as the value of the attached property VisualStateManager.VisualStateGroups.

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

You can also define this 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 collection in the source XAML for your application, see the VisualStateGroup.Transitions Property on MSDN.

Note

The contents of a custom ControlTemplate defined in Microsoft Silverlight 3 XAML cannot be accessed from C++. Therefore, visual transitions that were defined in a ControlTemplate in the source XAML for your application cannot be accessed in XAML for Windows Embedded object tree.

.NET Framework Equivalent

None.

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Collection Management
IXRVisualStateGroup::SetTransitions
IXRVisualStateGroup::GetTransitions