IXRTransformCollection (Compact 2013)

3/28/2014

This class represents a collection of IXRTransform objects that can be accessed individually by index.

Syntax

class IXRTransformCollection : public IXRDependencyObject

Inheritance Hierarchy

IXRDependencyObject

    IXRTransformCollection

Methods

Method

Description

IXRTransformCollection::Add

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

IXRTransformCollection::Clear

Removes all items from this collection.

IXRTransformCollection::Contains

Determines whether an item is in this collection.

IXRTransformCollection::GetCount

Retrieves the number of items in this collection.

IXRTransformCollection::GetItem

Retrieves the item at the specified index in this collection.

IXRTransformCollection::IndexOf

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

IXRTransformCollection::Insert

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

IXRTransformCollection::Remove

Removes a specific item from this collection.

IXRTransformCollection::RemoveAt

Removes the item at the specified index from this collection.

Thread Safety

For the best performance, use members of this class on a single thread. If you must access objects on multiple threads, you must also protect the objects using synchronization primitives such as lock, mutex and semaphore.

If necessary, when creating your visual host and prior to using members of this class, you can call IXRApplication::CreateHostFromXaml and supply it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true. This instructs XAML for Windows Embedded to keep the entire application thread-safe on your behalf. However, this practice can have undesirable performance side effects because the UI thread might be blocked by work going on in a background thread.

Remarks

IXRTransformCollection objects frequently are shared across multiple objects.

When you want to apply multiple transformation operations to a single object, use an IXRTransformGroup object. The IXRTransformGroup class uses the IXRTransformCollection to store IXRTransform information. This ordered collection describes the set of IXRTransform operations to apply when the IXRTransformGroup is applied to an object.

To obtain a pointer to this collection, call IXRTransformGroup::GetChildren. Then, use the methods of this collection to add, remove, or retrieve items. To clear the complete collection, call the IXRTransformCollection::Clear method.

You can also create a new collection. To do this, use the IXRApplication::CreateObject(IID,Object) method to create an empty IXRTransformCollection object. Then, use CreateObject to create multiple IXRTransform objects, each of which defines an IXRTransform operation to apply to the object when the IXRTransformGroup is applied. Next, add each IXRTransform object to the IXRTransformCollection collection by calling the IXRTransformCollection::Add method. And finally, set the new collection for an IXRTransformGroup by calling IXRTransformGroup::SetChildren.

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

You can also define a transform 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 TransformCollection Class on MSDN.

.NET Framework Equivalent

System.Windows.Media.TransformCollection

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Collection Management
IXRTransformGroup::GetChildren
IXRTransformGroup::SetChildren