title: WPF: The custom style is not working after changed the button background color
body: <p>After I clicked the button, the button's background color will always red. I hope the "isMouseOver" trigger still working.</p>
  
  <p>Anyone can help me to solve this problem? </p>
  
  <pre><code>&lt;Style TargetType="{x:Type Button}"&gt;
              &lt;Setter Property="OverridesDefaultStyle" Value="True"/&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                          &lt;Grid Background="{TemplateBinding Background}"&gt;
                              &lt;ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" /&gt;
                          &lt;/Grid&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                                  &lt;Setter Property="Background" Value="LightBlue"&gt;&lt;/Setter&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsMouseOver" Value="False"&gt;
                                  &lt;Setter Property="Background" Value="LightGray"&gt;&lt;/Setter&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <pre><code>private void onClick(object sender, RoutedEventArgs e)
          {
              Button button = sender as Button;
              button.Background = Brushes.Red;
          }
  </code></pre>