我想使用StringAnimationUsingKeyFrames
和动画文本框的文本DiscreteStringKeyFrame
<TextBlock x:Name="txtStateRunning" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock.Triggers>
<EventTrigger RoutedEvent="TextBlock.Loaded">
<BeginStoryboard>
<Storyboard x:Name="textAnimation">
<StringAnimationUsingKeyFrames Storyboard.TargetName="txtStateRunning"
Storyboard.TargetProperty="Text" RepeatBehavior="Forever" AutoReverse="False" >
<DiscreteStringKeyFrame Value="Running ." KeyTime="0:0:0" />
<DiscreteStringKeyFrame Value="Running .." KeyTime="0:0:0.5" />
<DiscreteStringKeyFrame Value="Running ..." KeyTime="0:0:1" />
<DiscreteStringKeyFrame Value="Running ...." KeyTime="0:0:1.5" />
</StringAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
在代码中我有 4 *DiscreteStringKeyFrame
但实际上我只看到 3 * 正在运行。DiscreteStringKeyFrame
at time 1.5 未执行。我错过了什么?