鉴于我的动画scene1
。如何使用C# code
后面的“跳过”按钮暂停它,然后播放另一个动画scene2
。
<Window.Resources>
<Storyboard x:Key="scene1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="whitebox">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:1.7" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<StringAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.Text)" Storyboard.TargetName="charName">
<DiscreteStringKeyFrame KeyTime="0:0:2" Value="Teacher"/>
<DiscreteStringKeyFrame KeyTime="0:0:7.8" Value="Teacher"/>
<DiscreteStringKeyFrame KeyTime="0:0:8" Value="Teacher"/>
</StringAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.HorizontalAlignment)" Storyboard.TargetName="charName">
<DiscreteObjectKeyFrame KeyTime="0:0:2" Value="{x:Static HorizontalAlignment.Left}"/>
<DiscreteObjectKeyFrame KeyTime="0:0:7.8" Value="{x:Static HorizontalAlignment.Left}"/>
<DiscreteObjectKeyFrame KeyTime="0:0:8" Value="{x:Static HorizontalAlignment.Left}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames
(too long… etc.)