title: WPF UserControl Mouseover make change child Border style
body: <p>I try to have mouse over style on user control, i can change user control border color with below code : </p>
  
  <pre><code>    &lt;UserControl.Style&gt;
      &lt;Style&gt;
          &lt;Setter Property="Border.Background" Value="Blue"/&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="Border.IsMouseOver" Value="True"&gt;
                  &lt;Setter Property="Border.Background" Value="Green" /&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  &lt;/UserControl.Style&gt;
  </code></pre>
  
  <p>But i need to improve my user control style, When i mouse over on it child border background change.Here is the code:</p>
  
  <pre><code>&lt;UserControl x:Class="R8500Receiver._UserControl.FormControl.DialBtn"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           mc:Ignorable="d" 
           d:DesignHeight="30" d:DesignWidth="43" MouseDown="UserControl_MouseDown"&gt;
  &lt;UserControl.Style&gt;
      &lt;Style&gt;
          &lt;Setter Property="Border.Background" Value="Blue"/&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="Border.IsMouseOver" Value="True"&gt;
                  &lt;Setter Property="Border.Background" Value="Green" /&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  &lt;/UserControl.Style&gt;
  &lt;Grid&gt;
      &lt;Border x:Name="ParentBorder" BorderBrush="Black" BorderThickness="1" Margin="0" CornerRadius="4" Background="#FF1F1D1D" Style="{StaticResource here}"&gt;
  
      &lt;/Border&gt;
      &lt;Border BorderBrush="#FF7A7A7A" BorderThickness="1" Margin="2" CornerRadius="4"&gt;
          &lt;Border.Background&gt;
              &lt;RadialGradientBrush&gt;
                  &lt;GradientStop Color="#FF1D1D1D" Offset="0.107"/&gt;
                  &lt;GradientStop Color="#FF322E2E" Offset="1"/&gt;
                  &lt;GradientStop Color="#FF303030" Offset="0.737"/&gt;
              &lt;/RadialGradientBrush&gt;
          &lt;/Border.Background&gt;
      &lt;/Border&gt;
      &lt;Label x:Name="DialAlpha" Content="ABC" FontSize="9" VerticalAlignment="Bottom" HorizontalAlignment="Right" Foreground="White" Padding="0" Margin="0,0,4,3" HorizontalContentAlignment="Center" FontFamily="Source Code Pro Black"/&gt;
      &lt;Label x:Name="DialNum" Content="1" VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="White" Padding="0" HorizontalContentAlignment="Center" Margin="8,2,0,0" RenderTransformOrigin="0.33,0.208" FontSize="17"/&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p><a href="https://i.stack.imgur.com/P0w3m.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P0w3m.jpg" alt="Print screen from VS 2015"></a></p>