title: Change Button Background color on EventTrigger in WPF
body: <p>I am trying to change the <code>Background</code> color of my Button when the user clicks it. I am using triggers to achieve it. </p>
  
  <p>My XAML is:</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;Style x:Key="myBtnStyle" TargetType="{x:Type Button}"&gt;
          &lt;!--VerticalAlignment="Top"  VerticalContentAlignment="Top" Background="Blue"  HorizontalAlignment="Right"
          Height="24" Width="25" FontSize="16" FontWeight="Bold"  --&gt;
          &lt;Setter Property="VerticalAlignment" Value="Top" /&gt; 
          &lt;Setter Property="VerticalContentAlignment" Value="Top" /&gt;
          &lt;Setter Property="Background" Value="Blue" /&gt;
          &lt;Setter Property="HorizontalAlignment" Value="Right" /&gt;
          &lt;Setter Property="Height" Value="24" /&gt;
          &lt;Setter Property="Width" Value="25" /&gt;
          &lt;Setter Property="FontSize" Value="16" /&gt;
          &lt;Setter Property="FontWeight" Value="Bold" /&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="Button.IsMouseOver" Value="true"&gt;
                  &lt;Setter Property="Background" Value="Yellow" /&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
   &lt;!--   
      &lt;ControlTemplate x:Key="btnTemplate" TargetType="{x:Type Button}"&gt;
          &lt;ControlTemplate.Triggers&gt;
              &lt;Trigger Property="IsPressed" Value="True" &gt;
                  &lt;Setter Property="Background" Value="Cyan" /&gt;
              &lt;/Trigger&gt;
  
          &lt;/ControlTemplate.Triggers&gt;
      &lt;/ControlTemplate&gt; --&gt;
  &lt;/UserControl.Resources&gt;
  
  &lt;Button DockPanel.Dock="Right" Style="{StaticResource myBtnStyle}"  Name="btnVert" Click="btnVert_Click"
                  Margin="10,10,10,0" ToolTip="Vertical" Content="V" /&gt;
  </code></pre>
  
  <p>I tried various settings, but couldn't get the Background color changed on the Button when mouse is clicked. Also referred various sites - <a href="http://msdn.microsoft.com/en-us/library/system.windows.trigger.property.aspx" rel="noreferrer">MSDN</a>, <a href="http://www.c-sharpcorner.com/uploadfile/raj1979/styles-using-triggers-in-wpf/" rel="noreferrer">SharpCorner</a>, <a href="http://www.codeproject.com/Articles/140623/WPF-Tutorial-Styles-Triggers-Animation" rel="noreferrer">CodeProject</a> and many others too. Couldn't get where am I going wrong?</p>
  
  <p>How to get the <code>Background</code> color changed of Button on clicked event?</p>
  
  <p>Thanks.</p>