1: <UserControl x:Class="StrobingEllipse.MainPage"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5: xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6: mc:Ignorable="d"
7: d:DesignHeight="125" d:DesignWidth="400">
8:
9: <StackPanel Orientation="Vertical">
10: <Button BorderThickness="1" Width="400" Height="125">
11: <Button.Content>
12: <StackPanel Orientation="Horizontal">
13: <Grid Width="100" Height="100" Margin="5">
14: <Ellipse Name="buttonEllipse" Fill="Green">
15: <Ellipse.Resources>
16: <Storyboard x:Name="colorStoryboardGreenToRed">
17: <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
18: Storyboard.TargetName="buttonEllipse"
19: Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">
20:
21: <!-- LinearColorKeyFrame creates a smooth, linear animation between values. -->
22: <LinearColorKeyFrame Value="Red" KeyTime="00:00:02" />
23:
24: </ColorAnimationUsingKeyFrames>
25: </Storyboard>
26: <Storyboard x:Name="colorStoryboardRedToGreen">
27: <ColorAnimationUsingKeyFrames BeginTime="00:00:00"
28: Storyboard.TargetName="buttonEllipse"
29: Storyboard.TargetProperty="(Ellipse.Fill).(SolidColorBrush.Color)">
30:
31: <!-- LinearColorKeyFrame creates a smooth, linear animation between values. -->
32: <LinearColorKeyFrame Value="Green" KeyTime="00:00:02" />
33:
34: </ColorAnimationUsingKeyFrames>
35: </Storyboard>
36: </Ellipse.Resources>
37: </Ellipse>
38: <Ellipse>
39: <Ellipse.Fill>
40: <RadialGradientBrush>
41: <GradientStop Offset="0" Color="#00000000"/>
42: <GradientStop Offset="0.88" Color="Black"/>
43: <GradientStop Offset="1" Color="#80000000"/>
44: </RadialGradientBrush>
45: </Ellipse.Fill>
46: </Ellipse>
47: <Ellipse Margin="10">
48: <Ellipse.Fill>
49: <LinearGradientBrush>
50: <GradientStop Offset="0" Color="#50FFFFFF"/>
51: <GradientStop Offset="0.5" Color="#00FFFFFF"/>
52: <GradientStop Offset="1" Color="#50FFFFFF"/>
53: </LinearGradientBrush>
54: </Ellipse.Fill>
55: </Ellipse>
56: </Grid>
57: <TextBlock x:Name="testResultText" Text="Pass" FontSize="30" Margin="10" VerticalAlignment="Center" />
58: </StackPanel>
59: </Button.Content>
60: </Button>
61: </StackPanel>
62: </UserControl>