Partager via


IXRVisualTransition::SetTo (Compact 2013)

3/28/2014

This method sets the name of the visual state to transition to.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetTo(
    __in const WCHAR* pTo
) = 0;

Parameters

  • pTo
    [in] Pointer to a string that contains the name of the visual state to transition to.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

You can design the appearance of visual states in control templates and in user controls.

Visual states are predefined in the templates of controls that meet the following criteria:

Examples of templates that have states already defined are the IXRButton and IXRTextBox controls. You cannot add or remove states to a control template. You can only define the appearance of those states and define the transition behavior between states.

The following list shows examples of visual states of control templates that can be specified in the pTo parameter. The availability of the following states depends upon the control:

  • Checked
  • Disabled
  • Focused
  • Indeterminate
  • MouseOver
  • Normal
  • Pressed
  • Unchecked
  • Unfocused

If you are working with states that you defined for a user control (a control that derives from the IXRUserControl class), you specify the name of your state in the pTo parameter.

Specifying a state to transition to, by calling this method, is optional. A visual transition can be restricted to apply to only certain states, or it can be applied any time that the control transitions between states. You restrict when an IXRVisualTransition object is applied to the control by calling IXRVisualTransition::SetTo and IXRVisualTransition::SetFrom.

The following table describes the levels of restriction, from most restrictive to least restrictive.

Kind of restriction

Value to set in SetFrom

Value to set in SetTo

From a specified state to another specified state

The Name of an IXRVisualState

The Name of an IXRVisualState

From any state to a specified state

Not set

The Name of an IXRVisualState

From a specified state to any state

The Name of an IXRVisualState

Not set

From any state to any other state

Not set

Note set

You can have multiple IXRVisualTransition objects in a collection that belongs to an IXRVisualStateGroup that refer to the same state. However, they will be used in the order that this table specifies.

You can define the To, From, and GeneratedDuration properties of a visual transition in Microsoft Silverlight 3 XAML, in the source XAML that is parsed by your application. 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 element in the source XAML for your application, see the VisualTransition.To Property and the VisualTransition Class on MSDN.

Note

The contents of a ControlTemplate defined in Microsoft Silverlight 3 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 XAML for Windows Embedded object tree.

.NET Framework Equivalent

System.Windows.VisualTransition.To

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRVisualTransition
IXRVisualTransition::GetTo