0
我想使圖像閃爍的設定次數,當我的可見性設置爲可見。當它完成閃爍時,我想讓它自己再次崩潰。我可以在WPF的Storyboard/Animation結尾處設置不同的屬性嗎?
這裏是什麼,我試圖做一個簡單的版本:
<Image Visibility="Collapsed"
Margin="0,0,3,0"
Width="24"
Source="blah"
Height="24">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="Visibility"
Value="Visible">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard RepeatBehavior="5x"
x:Name="flashingStoryboard">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Duration="0:0:1"
FillBehavior="Stop">
<DiscreteDoubleKeyFrame Value="0"
KeyTime="0:0:0" />
<DiscreteDoubleKeyFrame Value="1"
KeyTime="0:0:0.5" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
我能做到這一點的XAML?
我覺得你的解決方案對我來說不太合適,因爲RepeatBehavior。我已經添加了基於你的想法。 – user2871239 2014-09-03 11:55:02
您的解決方案帶來了相同的結果。我檢查了我的代碼,它的工作原理。 – Maximus 2014-09-03 12:24:51