Partager via


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

IXRVisualTransition::GetFrom

Retrieves the name of the visual state to transition from.

IXRVisualTransition::GetGeneratedDuration

Retrieves how long it takes to move from one state to another.

IXRVisualTransition::GetStoryboard

Retrieves the storyboard that begins to play when the transition occurs.

IXRVisualTransition::GetTo

Retrieves the name of the visual state to transition to.

IXRVisualTransition::SetFrom

Sets the name of the visual state to transition from

IXRVisualTransition::SetGeneratedDuration

Sets how long it takes to move from one state to another.

IXRVisualTransition::SetStoryboard

Sets the storyboard that begins to play when the transition occurs.

IXRVisualTransition::SetTo

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:

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:

  1. Create one or more new IXRVisualTransition objects and a new IXRVisualTransitionCollection.
  2. Add the IXRVisualTransition objects to the IXRVisualTransitionCollection by calling its inherited method IXRCollection<In_T, Out_T>::Add.
  3. Create a new IXRVisualStateGroup object, and add the new collection to it by calling IXRVisualStateGroup::SetTransitions.
  4. Create a new IXRVisualStateGroupCollection object, and add the IXRVisualStateGroup object to it by calling its inherited method IXRCollection<In_T, Out_T>::Add.
  5. Next, create a new IXRFrameworkElement root element to represent a new child element for the control.
  6. On the IXRFrameworkElement object, call IXRDependencyObject::SetAttachedProperty(const WCHAR*, IXRDependencyObject*) and set the IXRVisualStateGroupCollection object as the VisualStateManager.VisualStateGroups attached-property value.
  7. 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

IXRDependencyObject

    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

Other Resources