VisualStateGroup.Transitions VisualStateGroup.Transitions VisualStateGroup.Transitions VisualStateGroup.Transitions Property

Definición

Obtiene la colección de objetos VisualTransition.Gets the collection of VisualTransition objects.

public:
 property System::Collections::IList ^ Transitions { System::Collections::IList ^ get(); };
public System.Collections.IList Transitions { get; }
member this.Transitions : System.Collections.IList
Public ReadOnly Property Transitions As IList

Valor de propiedad

La colección de objetos VisualTransition.The collection of VisualTransition objects.

Ejemplos

En el ejemplo siguiente se crea ControlTemplate un sencillo Button para un que Gridcontiene uno.The following example creates a simple ControlTemplate for a Button that contains one Grid. También contiene un VisualStateGroup denominado CommonStates, que define los MouseOver Estados y Normal .It also contains a VisualStateGroup named CommonStates, which defines the MouseOver and Normal states. También tiene un VisualTransition que especifica que tardará Grid un segundo medio en cambiar de verde a rojo cuando el usuario mueva el puntero del mouse sobre el Button. VisualStateGroupThe VisualStateGroup also has a VisualTransition that specifies that it takes one half second for the Grid to change from green to red when the user moves the mouse pointer over the Button.

<ControlTemplate TargetType="Button">
  <Grid >
    <VisualStateManager.VisualStateGroups>
      <VisualStateGroup x:Name="CommonStates">

        <VisualStateGroup.Transitions>

          <!--Take one half second to trasition to the MouseOver state.-->
          <VisualTransition To="MouseOver" 
            GeneratedDuration="0:0:0.5"/>
        </VisualStateGroup.Transitions>

        <VisualState x:Name="Normal" />

        <!--Change the SolidColorBrush, ButtonBrush, to red when the
            mouse is over the button.-->
        <VisualState x:Name="MouseOver">
          <Storyboard>
            <ColorAnimation Storyboard.TargetName="ButtonBrush" 
              Storyboard.TargetProperty="Color" To="Red" />
          </Storyboard>
        </VisualState>
      </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
    <Grid.Background>
      <SolidColorBrush x:Name="ButtonBrush" Color="Green"/>
    </Grid.Background>
  </Grid>
</ControlTemplate>

Comentarios

Los VisualTransition objetos de Transitions se aplican cuando el control realiza la transición entre Estados definidos en VisualStateGroup.The VisualTransition objects in Transitions are applied when the control transition between states that are defined in the VisualStateGroup.

Se aplica a