Language

VisualTransition.Storyboard プロパティ

定義

遷移が発生したときに発生する Storyboard を取得または設定します。

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 。

例

次の例では、ユーザーがマウスをコントロールから離したときに、コントロールの境界線が青、黄色、1.5 秒で黒に変わることを指定する VisualTransition を作成します。 例全体については、「コントロールの テンプレートを作成する方法」を参照してください。

<!--Take one and a half seconds to transition from the
    MouseOver state to the Normal state. 
    Have the SolidColorBrush, BorderBrush, fade to blue, 
    then to yellow, and then to black in that time.-->
<VisualTransition From="MouseOver" To="Normal" 
                      GeneratedDuration="0:0:1.5">
  <Storyboard>
    <ColorAnimationUsingKeyFrames
      Storyboard.TargetProperty="Color"
      Storyboard.TargetName="BorderBrush"
      FillBehavior="HoldEnd" >

      <ColorAnimationUsingKeyFrames.KeyFrames>

        <LinearColorKeyFrame Value="Blue" 
          KeyTime="0:0:0.5" />
        <LinearColorKeyFrame Value="Yellow" 
          KeyTime="0:0:1" />
        <LinearColorKeyFrame Value="Black" 
          KeyTime="0:0:1.5" />

      </ColorAnimationUsingKeyFrames.KeyFrames>
    </ColorAnimationUsingKeyFrames>
  </Storyboard>
</VisualTransition>

注釈

VisualTransitionにStoryboardが含まれている場合、Storyboardが適用されるたびにVisualTransitionが実行されます。 たとえば、ユーザーがマウスを離したときにButtonの境界線で色を変更する場合は、ボタンの背景を変更するVisualTransitionを含むStoryboardを作成できます。

適用対象