Question : How to make my WPF button keep shining

Dear All,

The attached code is style of the button. When moving mouse over the button it will be shining.

My question is: how to make the button always keep shining, even if I don't touch the mouse. (for example the button itself will keep shining every X seconds...)

Thanks heaps!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
<Style x:Key="aquaButton" TargetType="Button">
        <Setter Property="FontWeight" Value="UltraBold"/>
        <Setter Property="Foreground" Value="#B3000000"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Ellipse x:Name="backgroundGlow" Fill="Yellow"/>
                        <Ellipse x:Name="outterGlow" Fill="Yellow" Opacity="0">
                            <Ellipse.BitmapEffect>
                                <OuterGlowBitmapEffect GlowColor="Aqua" GlowSize="10"/>
                            </Ellipse.BitmapEffect>
                        </Ellipse>
                        <Ellipse x:Name="mainButton" Fill="Blue" Opacity="0.85"/>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Panel.ZIndex="1"/>
                        <Ellipse x:Name="shine" Opacity="1">
                            <Ellipse.Fill>
                                <LinearGradientBrush StartPoint="0,-0.1" EndPoint="0,1">
                                    <GradientStop Color="White" Offset="0"/>
                                    <GradientStop Color="White" Offset="0.1"/>
                                    <GradientStop Color="Transparent" Offset="0.5"/>
                                </LinearGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Ellipse x:Name="shadow" Opacity="0.50">
                            <Ellipse.Fill>
                                <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                    <GradientStop Color="#FF000337" Offset="0"/>
                                    <GradientStop Color="#FF000337" Offset="0.2"/>
                                    <GradientStop Color="Transparent" Offset="1"/>
                                </LinearGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Ellipse x:Name="buttonBorder"  Stroke="#FF706CEA" StrokeThickness="2"/>
                        <Ellipse x:Name="buttonOutline" Stroke="DarkBlue" StrokeThickness="1"/>
                        <Ellipse x:Name="hoverShine" Opacity="0">
                            <Ellipse.Fill>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                    <GradientStop Color="White" Offset="0"/>
                                    <GradientStop Color="White" Offset="0.1"/>
                                    <GradientStop Color="Transparent" Offset="1"/>
                                </LinearGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Button.IsMouseOver" Value="True"/>
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="hoverShine"
                                    Storyboard.TargetProperty="Opacity"
                                    To="0.40"
                                    Duration="0:0:0.1"/>
                                        <DoubleAnimation Storyboard.TargetName="outterGlow"
                                     Storyboard.TargetProperty="Opacity"
                                     To="1"
                                     Duration="0:0:0.1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="hoverShine"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0"
                                        Duration="0:0:0.25"/>
                                        <DoubleAnimation Storyboard.TargetName="outterGlow"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0"
                                        Duration="0:0:0.25"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Button.IsMouseOver" Value="True"/>
                                <Condition Property="Button.IsPressed" Value="True"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="shine" Property="Opacity" Value="0.85"/>
                            <Setter TargetName="shadow" Property="Opacity" Value="0.85"/>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="hoverShine"
                                         Storyboard.TargetProperty="Opacity"                                         
                                         To="0"
                                         Duration="0:0:0.1"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="hoverShine"
                                        Storyboard.TargetProperty="Opacity"
                                        To="0.40"
                                        Duration="0:0:0.25"/>
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Answer : How to make my WPF button keep shining

Like so:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        
        <Style x:Key="aquaButton" TargetType="Button">
            <Setter Property="FontWeight" Value="UltraBold"/>
            <Setter Property="Foreground" Value="#B3000000"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate x:Name="ButtonShiner" TargetType="Button">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="ShowButtonAnimation" RepeatBehavior="Forever">
                                <DoubleAnimation Storyboard.TargetName="hoverShine"
                                    Storyboard.TargetProperty="(UIElement.Opacity)"
                                    To="0.40"
				                    AutoReverse="True" BeginTime="0:0:3"
                                    Duration="0:0:0.3"/>
                                <DoubleAnimation Storyboard.TargetName="outterGlow"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     To="1"
				                     AutoReverse="True" BeginTime="0:0:3"
                                     Duration="0:0:0.3"/>
                                <DoubleAnimation Storyboard.TargetName="shine"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     To="0.85"
				                     AutoReverse="True" BeginTime="0:0:3"
                                     Duration="0:0:0.3"/>
                                <DoubleAnimation Storyboard.TargetName="shadow"
                                     Storyboard.TargetProperty="(UIElement.Opacity)"
                                     To="0.85"
				                     AutoReverse="True" BeginTime="0:0:3"
                                     Duration="0:0:0.3"/>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <Grid>
                            <Ellipse x:Name="backgroundGlow" Fill="Yellow"/>
                            <Ellipse x:Name="outterGlow" Fill="Yellow" Opacity="0">
                                <Ellipse.BitmapEffect>
                                    <OuterGlowBitmapEffect GlowColor="Aqua" GlowSize="10"/>
                                </Ellipse.BitmapEffect>
                            </Ellipse>
                            <Ellipse x:Name="mainButton" Fill="Blue" Opacity="0.85"/>
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Panel.ZIndex="1"/>
                            <Ellipse x:Name="shine" Opacity="1">
                                <Ellipse.Fill>
                                    <LinearGradientBrush StartPoint="0,-0.1" EndPoint="0,1">
                                        <GradientStop Color="White" Offset="0"/>
                                        <GradientStop Color="White" Offset="0.1"/>
                                        <GradientStop Color="Transparent" Offset="0.5"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="shadow" Opacity="0.50">
                                <Ellipse.Fill>
                                    <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                        <GradientStop Color="#FF000337" Offset="0"/>
                                        <GradientStop Color="#FF000337" Offset="0.2"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse x:Name="buttonBorder"  Stroke="#FF706CEA" StrokeThickness="2"/>
                            <Ellipse x:Name="buttonOutline" Stroke="DarkBlue" StrokeThickness="1"/>
                            <Ellipse x:Name="hoverShine" Opacity="0">
                                <Ellipse.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Color="White" Offset="0"/>
                                        <GradientStop Color="White" Offset="0.1"/>
                                        <GradientStop Color="Transparent" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                        </Grid>
                        <ControlTemplate.Triggers> 
                            <Trigger Property="IsEnabled" Value="True">
                                <Trigger.EnterActions>
                                    <BeginStoryboard x:Name="ShowButtonAnimationStart" Storyboard="{StaticResource ShowButtonAnimation}"/>
                                </Trigger.EnterActions>
                                <Trigger.ExitActions>
                                    <StopStoryboard BeginStoryboardName="ShowButtonAnimationStart"/>
                                </Trigger.ExitActions>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Window.Resources>
    <Grid>
        <Button Width="100" Height="100" Style="{StaticResource ResourceKey=aquaButton}" Name="ShinyButton" />
    </Grid>

</Window>
Random Solutions  
 
programming4us programming4us