IXRVisualTransition (Windows Embedded CE 6.0)
1/6/2010
This class represents the visual behavior that occurs when the control transitions from one state to another.
Syntax
class IXRVisualTransition : public IXRDependencyObject
Methods
Method | Description |
---|---|
Retrieves the name of the visual state to transition from. |
|
Retrieves how long it takes to move from one state to another. |
|
Retrieves the storyboard that begins to play when the transition occurs. |
|
Retrieves the name of the visual state to transition to. |
|
Sets the name of the visual state to transition from |
|
Sets how long it takes to move from one state to another. |
|
Sets the storyboard that begins to play when the transition occurs. |
|
Sets the name of the visual state to transition to. |
Remarks
You can specify how the control visually transitions between states by creating IXRVisualTransition objects and adding them to an IXRVisualTransitionCollection object that is attached to the child element of a user control.
When you create a visual transition, you do one or more of the following:
- Specify the time that is required for a transition between states to occur by calling IXRVisualTransition::SetGeneratedDuration.
- Specify additional changes in the control's appearance that occur at the time of the transition by calling IXRVisualTransition::SetStoryboard.
- Specify the state change when the visual transition is applied by calling IXRVisualTransition::SetTo and IXRVisualTransition::SetFrom.
To add an IXRVisualTransitionCollection to a user control, first create an IXRVisualStateGroup object and then call IXRVisualStateGroup::SetTransitions. Next, add the IXRVisualStateGroup object to an IXRVisualStateGroupCollection.
A collection of visual-state groups, represented by IXRVisualStateGroupCollection, is accessible through an attached property on an IXRFrameworkElement child element of an IXRUserControl. The attached property is called VisualStateManager.VisualStateGroups.
To use this object in C++, the control must inherit from IXRUserControl, which inherits from IXRControl. Then, you can do the following:
- Create one or more new IXRVisualTransition objects and a new IXRVisualTransitionCollection.
- Add the IXRVisualTransition objects to the IXRVisualTransitionCollection by calling its inherited method IXRCollection<In_T, Out_T>::Add.
- Create a new IXRVisualStateGroup object, and add the new collection to it by calling IXRVisualStateGroup::SetTransitions.
- Create a new IXRVisualStateGroupCollection object, and add the IXRVisualStateGroup object to it by calling its inherited method IXRCollection<In_T, Out_T>::Add.
- Next, create a new IXRFrameworkElement root element to represent a new child element for the control.
- On the IXRFrameworkElement object, call IXRDependencyObject::SetAttachedProperty(const WCHAR*, IXRDependencyObject*) and set the IXRVisualStateGroupCollection object as the VisualStateManager.VisualStateGroups attached-property value.
- After the visual transitions are added to the IXRFrameworkElement root element, add the root element to the user control by calling IXRUserControl::SetContent.
You can also define a visual transition in Microsoft Silverlight 2 XAML, in the source XAML that is parsed by your application. 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.
Note
The contents of a ControlTemplate defined in Microsoft Silverlight 2 XAML cannot be accessed from C++. Therefore, visual transitions and visual-state groups that were defined in a ControlTemplate in the source XAML for your application cannot be accessed in Silverlight object tree.
Inheritance Hierarchy
IXRVisualTransition
.NET Framework Equivalent
System.Windows.VisualTransition
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
IXRControl::GoToVisualState