<Window x:Class="WpfBlinkingLabel.MainWindow"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfBlinkingLabel"
        mc:Ignorable="d"
        Title="WpfBlinkingLabel"
    Height="127" Width="350"
    Loaded="Window_Loaded" FontSize="20">
    <Window.Resources>
        <Storyboard x:Key="blinkStory" Duration="0:0:1"
            RepeatBehavior="Forever">
            <ColorAnimationUsingKeyFrames
                Storyboard.TargetName="storyboardLabel"
                Storyboard.TargetProperty="Background.(SolidColorBrush.Color)">
                <DiscreteColorKeyFrame KeyTime="0:0:0" Value="Blue" />
                <DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="Yellow" />
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames
                Storyboard.TargetName="storyboardLabel"
                Storyboard.TargetProperty="Foreground.(SolidColorBrush.Color)">
                <DiscreteColorKeyFrame KeyTime="0:0:0" Value="Yellow" />
                <DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="Blue" />
            </ColorAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource blinkStory}"/>
        </EventTrigger>
    </Window.Triggers>
    <StackPanel Width="150" Margin="5">
        <Label Name="timerLabel" Content="Timer" HorizontalAlignment="Center" />
        <Label Name="storyboardLabel" Content="Storyboard" HorizontalAlignment="Center" />
    </StackPanel>
</Window>
