Wpf 在XAML中完成故事板彩色动画后,如何设置背景?
在XAML中完成故事板彩色动画后,如何设置背景 我的彩色动画运行,使背景闪烁红色,但在它返回到原始背景颜色(白色)后,我希望它提醒红色,但我不知道如何做到这一点 我的xaml在下面-谢谢Wpf 在XAML中完成故事板彩色动画后,如何设置背景?,wpf,xaml,Wpf,Xaml,在XAML中完成故事板彩色动画后,如何设置背景 我的彩色动画运行,使背景闪烁红色,但在它返回到原始背景颜色(白色)后,我希望它提醒红色,但我不知道如何做到这一点 我的xaml在下面-谢谢 <Grid Name="cell" Background="White"> <Grid.Style> <Style> <Sty
<Grid Name="cell" Background="White">
<Grid.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding DataItem.ControlValue, Converter={StaticResource IsNotNullOrEmptyConverter}}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard x:Name="Blink" >
<ColorAnimation Storyboard.TargetProperty="Background.Color" To="Red"
RepeatBehavior="3x" Duration="0:0:1" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<RemoveStoryboard BeginStoryboardName="Blink" />
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
如果您不想将彩色动画恢复为原始值(即白色),请将其设置为
False
<ColorAnimation Storyboard.TargetProperty="Background.Color" To="Red"
RepeatBehavior="3x" Duration="0:0:1" AutoReverse="False"/>
我想要自动翻转提供的淡出视觉效果-可以保持淡出效果吗?谢谢,请检查答案中的更新,看看是否有帮助。
<BeginStoryboard>
<Storyboard x:Name="Blink">
<ColorAnimation Storyboard.TargetProperty="Background.Color" To="Red"
RepeatBehavior="3x" Duration="0:0:1" AutoReverse="True"/>
<ColorAnimation Storyboard.TargetProperty="Background.Color" To="Red"
Duration="0:0:1" BeginTime="0:0:4"/>
</Storyboard>
</BeginStoryboard>