<Button Content="Button" HorizontalAlignment="Stretch" Margin="193,114,0,0" VerticalAlignment="Top" Width="75" Height="30">
<Button.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation BeginTime="0:0:2" RepeatBehavior="6" Storyboard.TargetProperty="Width" To="150" Duration="0:0:4"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
设置了动画的重复次数为6次,可结果是无限次数的重复,why ?
“Forever”使Timeline不断地重复。
一个时间段表示Timeline运行的时间长度。例如,将一个Duration为2.5秒的动画的RepeatBehavior设为“0:0:5”会使动画重复两次。
重复次数指定了Timeline运行的次数。您使用下面的语法来指定重复次数:重复次数x。例如,“4x”表示Timeline重复四次。
该属性默认值为“1x”,表示时间线只会执行一次。