Windows desktop applications
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

VisualTransition.To property

Gets or sets the name of the VisualState to transition to.

Syntax


public string To { get; set; }


<object To="stateName"/>

XAML Values

stateName

The name of the VisualState to transition to.

Property value

Type: System.String [.NET] | Platform::String [C++]

The name of the VisualState to transition to.

Remarks

A VisualTransition references either one or two named visual states. The From value references the name of a state that should be the current state. The To value references the name of a state that is the new state requested by a GoToState call. These names come from a Name or x:Name attribute string value that is applied to a VisualState as part of its definition in the same VisualStateGroup. Either From or To are a required value for an effective VisualTransition, a VisualTransition that lacks either of these values or uses values that don't match existing states does nothing.

A VisualTransition can reference just a From state, just a To state, or both a From and To state. Omitting either From or To equates to any state. The VisualStateManager uses a precedence logic for which transition to apply whenever visual states change:

  1. If a VisualTransition exists that specifically references the old state as From and the new state as To, use that transition.
  2. Otherwise, if a VisualTransition exists that specifically references the new state as To but does not specify From, use that transition.
  3. Finally, if a VisualTransition exists that specifically references the old state as From but does not specify To , use that transition.

If none of the above apply, no transition runs.

Examples

This example creates two VisualTransition objects. When the control transitions from the "Pressed" state to the "PointerOver" state, the VisualTransition that has both From and To set is used. When the control transitions from a state that is not "Pressed" to the "PointerOver" state, the other state is used.


<!--Take one half second to transition to the PointerOver state.-->
<VisualTransition To="PointerOver" 
                      GeneratedDuration="0:0:0.5" />

<!--Take one hundredth of a second to transition from the
    Pressed state to the PointerOver state.-->
<VisualTransition From="Pressed" To="PointerOver" 
                      GeneratedDuration="0:0:0.01" />


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.winmd

See also

VisualTransition

 

 

Show:
© 2016 Microsoft