title: How to make my control focusable?
body: <p>I have a control</p>
  
  <pre><code>public class FocusTestControl : Control {
      public FocusTestControl() {
          DefaultStyleKey = typeof(FocusTestControl);
      }
  }
  </code></pre>
  
  <p>Here is it's default style</p>
  
  <pre><code>    &lt;Style
      TargetType="local:FocusTestControl"&gt;
      &lt;Setter
          Property="Focusable"
          Value="True" /&gt;
      &lt;Setter
          Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate&gt;
                  &lt;Grid&gt;
                      &lt;Border
                          Background="AliceBlue" /&gt;
                  &lt;/Grid&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>I put this control on a window:</p>
  
  <pre><code>&lt;Window
  x:Class="MakeWpfControlFocusable.MainWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:MakeWpfControlFocusable"
  Title="MainWindow"
  Height="350"
  Width="525"&gt;
  &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition /&gt;
          &lt;RowDefinition
              Height="35" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;local:FocusTestControl /&gt;
      &lt;StackPanel
          Grid.Row="1"
          Orientation="Horizontal"&gt;
          &lt;TextBlock
              Text="Focused element: " /&gt;
          &lt;TextBlock
              Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=KeyboardFocusedElement}" /&gt;
          &lt;TextBox
              Text="Text" /&gt;
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>But clicking on control doesn't make it focused (I mean KebordFocus)</p>
  
  <p>Actually, my task is handle the KeyDown and KeyUp events. But it is impossible when element has no keybord focus.</p>