IXRVisualStateGroupCollection (Compact 2013)
3/28/2014
This class represents a collection of IXRVisualStateGroup objects that contain IXRVisualState objects, which define particular visual states, and IXRVisualTransition objects, which are used to go from one state to another.
Syntax
class IXRVisualStateGroupCollection : public IXRDependencyObject
Inheritance Hierarchy
IXRVisualStateGroupCollection
Methods
Method |
Description |
---|---|
Adds an item to the end of this collection and retrieves the index of where it was added. |
|
Removes all items from this collection. |
|
Determines whether an item is in this collection. |
|
Retrieves the number of items in this collection. |
|
Retrieves the item at the specified index in this collection. |
|
Searches for the specified item and retrieves the zero-based index of its last occurrence within this collection. |
|
Inserts an item into this collection at the specified index. |
|
Removes a specific item from this collection. |
|
Removes the item at the specified. |
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 state groups:
- Use the IXRApplication::CreateObject(IID,Object) method to create an empty IXRVisualStateGroupCollection object.
- Use CreateObject to create multiple IXRVisualStateGroup objects that each define the visual appearance for states and state transitions for an IXRUserControl object.
- Add each IXRVisualStateGroup object to the IXRVisualStateGroupCollection collection by calling the IXRVisualStateGroupCollection::Add method.
- Set the new collection for an IXRFrameworkElement child element of an IXRUserControl object, retrieved by the method IXRUserControl::GetContent. To do this, call IXRDependencyObject::SetAttachedProperty(const WCHAR*, const WCHAR*, IXRDependencyObject*) on the child element and set the value for its attached property VisualStateManager.VisualStateGroups.
When you create a class instance, use an IXRVisualStateGroupCollectionPtr 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 Class on MSDN.
Note
The contents of a ControlTemplate defined in Microsoft Silverlight 3 XAML cannot be accessed from C++. Therefore, visual-state groups 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 |