title: WPF set border background in trigger
body: <p>I need to create a trigger, that will change Border background property, when MouseEnter occurred. I did the follow:</p>
  
  <pre><code>&lt;Border Width="20" Height="30" Focusable="True"&gt;
          &lt;Border.Background&gt;
              &lt;LinearGradientBrush&gt;
                  &lt;LinearGradientBrush.GradientStops&gt;
                      &lt;GradientStop Color="Aquamarine" Offset="0"/&gt;
                  &lt;/LinearGradientBrush.GradientStops&gt;
              &lt;/LinearGradientBrush&gt;
          &lt;/Border.Background&gt;
          &lt;Border.Style&gt;
              &lt;Style TargetType="{x:Type Border}"&gt;
                  &lt;Style.Triggers&gt;
  
                      &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                          &lt;Setter Property="Background"&gt;
                              &lt;Setter.Value&gt;
                                  &lt;LinearGradientBrush&gt;
                                      &lt;LinearGradientBrush.GradientStops&gt;
                                          &lt;GradientStop Color="Aquamarine" Offset="0"/&gt;
                                          &lt;GradientStop Color="Beige" Offset="0.2"/&gt;
                                          &lt;GradientStop Color="Firebrick" Offset="0.5"/&gt;
                                          &lt;GradientStop Color="DarkMagenta" Offset="0.9"/&gt;
                                      &lt;/LinearGradientBrush.GradientStops&gt;
                                  &lt;/LinearGradientBrush&gt;
                              &lt;/Setter.Value&gt;
                          &lt;/Setter&gt;
                      &lt;/Trigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/Border.Style&gt;
      &lt;/Border&gt;
  </code></pre>
  
  <p>but it doesn't work. Thanks.</p>