VisualState.Storyboard 속성

정의

컨트롤이 Storyboard가 나타내는 상태일 때 컨트롤의 모양을 정의하는 VisualState를 가져오거나 설정합니다.

public:
 property System::Windows::Media::Animation::Storyboard ^ Storyboard { System::Windows::Media::Animation::Storyboard ^ get(); void set(System::Windows::Media::Animation::Storyboard ^ value); };
public System.Windows.Media.Animation.Storyboard Storyboard { get; set; }
member this.Storyboard : System.Windows.Media.Animation.Storyboard with get, set
Public Property Storyboard As Storyboard

속성 값

Storyboard

컨트롤이 VisualState가 나타내는 상태일 때 컨트롤의 모양을 정의하는 스토리보드입니다. 기본값은 null입니다.

예제

다음 예제에서는 간단한 ControlTemplate 에 대 한는 Button 하나를 포함 하는 Grid합니다. 합니다 VisualState 호출 MouseOver 의 색을 변경 하는 스토리 보드에는 Grid 를 통해 사용자가 마우스 녹색에서 빨간색 경우는 Button합니다. VisualState 호출 Normal 포함 되어 사용자가 단추 밖으로 마우스를 이동 하는 경우는 Grid 녹색으로 반환 합니다.

<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>

설명

컨트롤에 지정 된 상태로 전환 하는 경우는 VisualState.Name 속성을 Storyboard 시작 합니다. 컨트롤 상태를 종료 하는 경우는 Storyboard 중지 합니다.

적용 대상