代码拉取完成,页面将自动刷新
<Window
x:Class="TimeCountDown.Blink"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:TimeCountDown"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Blink"
Width="800"
Height="450"
mc:Ignorable="d">
<Window.Resources>
<Style TargetType="Label">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="0">
<Setter Property="Background" Value="Green">
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="1">
<Setter Property="Background" Value="Red">
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" Value="2">
<DataTrigger.EnterActions>
<BeginStoryboard Name="Shine">
<Storyboard RepeatBehavior="Forever">
<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="Background.Color">
<EasingColorKeyFrame KeyTime="0" Value="Red">
</EasingColorKeyFrame>
<EasingColorKeyFrame KeyTime="0:0:0.5" Value="Green">
</EasingColorKeyFrame>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<StopStoryboard BeginStoryboardName="Shine" />
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<StackPanel HorizontalAlignment="Center">
<Label
Width="81"
Height="45"
Margin="5"
Foreground="White"
Tag="0" />
<Label
Width="81"
Height="45"
Margin="5"
Foreground="White"
Tag="1" />
<Label
Width="81"
Height="45"
Margin="5"
Background="Green"
Foreground="White"
Tag="2" />
</StackPanel>
</Grid>
</Window>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。