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

遷移が行われたときに発生する Storyboard

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

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

注釈

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

適用対象