title: How to correctly set an WPF EventTrigger in style?
body: <p>I have a WPF style that is a border. It is used for a button.</p>
  
  <pre><code>&lt;Style x:Key="RoundCorner" TargetType="{x:Type Button}"&gt;
      &lt;Setter Property="ClickMode" Value="Press"/&gt;
      &lt;EventSetter Event="PreviewMouseUp" Handler="RegularButtonRelease"/&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                  &lt;Grid x:Name="grid"&gt;
                      &lt;Border x:Name="border" CornerRadius="2" BorderBrush="#FF444444" BorderThickness="1"&gt;
                          &lt;Border.Background&gt;
                              &lt;LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1.2" &gt;
                                  &lt;GradientStop Color="#ffaaaaaa" Offset="0" /&gt;
                                  &lt;GradientStop Color="White" Offset="1" /&gt;
                              &lt;/LinearGradientBrush&gt;                             
                          &lt;/Border.Background&gt;
                      &lt;/Border&gt;
                  &lt;/Grid&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsPressed" Value="True"&gt;
                          &lt;!--some style --&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                          &lt;!--some style --&gt;                                
                      &lt;/Trigger&gt;
                      &lt;EventTrigger RoutedEvent="PreviewMouseLeftButtonUp"&gt;
                          &lt;BeginStoryboard&gt;
                              &lt;Storyboard Duration="0:0:2" AutoReverse="False"&gt;
                                  &lt;ColorAnimation 
                                      Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" 
                                      FillBehavior="Stop" To="Tomato"/&gt;
                              &lt;/Storyboard&gt;
                          &lt;/BeginStoryboard&gt;
                      &lt;/EventTrigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>I want to set the border background color to a different one for a given time, when I release the mouse click on the button. (e.g. the button is black when pressed, and when I release, it changes to red, then changes back to white)</p>
  
  <p>Using the above code, I can see the button color keep changing  after I release mouse button, and my event handler <code>RegularButtonRelease</code> is fired continuously too.
  Soon the appplication hangs, and gives me a <code>System.StackOverflowException</code> 
  exception.</p>
  
  <p>If I take away the <code>EventTrigger</code> in style, my applications perform correctly, so my EventTrigger must be wrong.</p>
  
  <p>My question is, how could I correctly set a background color change at mouse button up (using the EventTrigger  or something else)?</p>
  
  <p><em>UPDATE:</em></p>
  
  <p>I try to set the border and background at the same time using:</p>
  
  <pre><code>&lt;ColorAnimation 
      Duration="0:0:0.8" 
      Storyboard.TargetName="border" 
      Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" 
      To="Red"/&gt;
  &lt;ColorAnimation 
      Duration="0:0:0.8" 
      Storyboard.TargetName="border" 
      Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" 
      To="Red"/&gt;
  </code></pre>
  
  <p>This time the border line is changing to red, works like a charm. But the background still sits there, no any changes.</p>
  
  <p>How can I correctly change my background?</p>