How to make button and background flash in wpf
<h2>Issue</h2>

<hr>

<p>The issue I am having is when a user clicks a button I want the button to start flashing from 100% visible to around 20% visible and the background of the WPF window to change colors from <code>#ffffff</code> to <code>#d6786a</code> and this should happen untill the button is clicked again. Then the animations should stop.</p>

<h2>Code</h2>

<hr>

<p>I have done a bit of diging around to find where somone has done this and I can't seem to see anything. The code i have at the moment is as follows.</p>

<p>Here is the button I want to flash from 100% visible to 20% visible when clicked:</p>

<pre><code>&lt;Button Name="button2" Style="{DynamicResource NoChromeButton}" Visibility="{Binding VisableState, Converter={StaticResource BoolToVis}}" ToolTip="Start Live Stream" Command="{Binding PlayStream}" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="5" Height="22" Width="22" &gt;
    &lt;Image Source="../Images/recordicon.png"/&gt;
&lt;/Button&gt;
</code></pre>

<p>I have tried to add a storyboard into the button and it just didn't work:</p>

<pre><code>&lt;Button.Triggers&gt;
  &lt;EventTrigger RoutedEvent="Button.Click"&gt;
    &lt;EventTrigger.Actions&gt;
      &lt;BeginStoryboard&gt;
        &lt;Storyboard BeginTime="00:00:00" 
                                RepeatBehavior="Forever" 
                                Storyboard.TargetName="button2" 
                                Storyboard.TargetProperty="(Visibility)"&gt;
        &lt;/Storyboard&gt;
      &lt;/BeginStoryboard&gt;
    &lt;/EventTrigger.Actions&gt;
  &lt;/EventTrigger&gt;
&lt;/Button.Triggers&gt;
</code></pre>

<p>I am new to WPF so going into animation is more difficult for me. If anyone could give me a little help on this stage it would be great.</p>