title: Change usercontrol border on its GotFocus-event within the XAML of a WPF-Project
body: <p>I have a UserControl, which contains a Grid which contains a Border:</p>
  
  <pre><code>&lt;UserControl Focusable="True" Name="uctrlScenePanel"&gt;
      &lt;Grid MouseDown="Grid_MouseDown"&gt;
        &lt;Border BorderThickness="0" BorderBrush="Black"&gt;
        &lt;/Border&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>I now wanted to change the Border-Thickness once the usercontrol "uctrlScenePanel" got Focus, but i can't get it to work and i dont really find useful Eventtrigger-Tutorials which a can understand, because i am very new to WPF.</p>
  
  <p>edit:
  d.moncada's answer was very helpful! my xaml now looks like this:</p>
  
  <pre><code>       &lt;Border BorderBrush="Black"&gt;
              &lt;Border.Style&gt;
                  &lt;Style TargetType="Border"&gt;
                      &lt;Setter Property="BorderThickness" Value="0" /&gt;
                      &lt;Style.Triggers&gt;
                          &lt;DataTrigger Binding="{Binding IsKeyboardFocusWithin, ElementName=uctrlScenePanel}" Value="true"&gt;
                              &lt;Setter Property="BorderThickness" Value="2" /&gt;
                              &lt;Setter Property="Background" Value="Green" /&gt;
                          &lt;/DataTrigger&gt;
                          &lt;DataTrigger Binding="{Binding IsKeyboardFocusWithin, ElementName=uctrlScenePanel}" Value="false"&gt;
                              &lt;Setter Property="BorderThickness" Value="0" /&gt;
                          &lt;/DataTrigger&gt;
                      &lt;/Style.Triggers&gt;
                  &lt;/Style&gt;
              &lt;/Border.Style&gt;
          &lt;/Border&gt;
  </code></pre>
  
  <p>I have still problems,because the focusing of a user control behaves weird, but thats another story...this one is solved for me, thanks for the lesson ;) </p>