VisualStateGroup.Transitions Vlastnost

Definice

Získá kolekci VisualTransition objektů.

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

Hodnota vlastnosti

Kolekce VisualTransition objektů.

Příklady

Následující příklad vytvoří jednoduchý ControlTemplate pro Button ten, který obsahuje jeden Grid. Obsahuje také pojmenovaný VisualStateGroup, CommonStates který definuje MouseOver a Normal stavy. Má VisualStateGroup také VisualTransition , který určuje, že trvá jednu půl sekundu Grid , než se změna ze zelené na červenou, když uživatel přesune ukazatel myši na 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>

Poznámky

Objekty VisualTransition se Transitions použijí při přechodu ovládacího prvku mezi stavy, které jsou definovány VisualStateGroupv .

Platí pro