title: How to focus in WPF with WindowsFormHost
body: <p>I have this simple setup:</p>
  
  <pre><code>&lt;StackPanel&gt;
      &lt;TextBox Text="wpf1" PreviewLostKeyboardFocus="TextBox_PreviewLostKeyboardFocus" /&gt;
      &lt;TextBox Text="wpf2" PreviewLostKeyboardFocus="TextBox_PreviewLostKeyboardFocus" /&gt;
      &lt;WindowsFormsHost&gt;
          &lt;wf:TextBox Text="winforms" /&gt;
      &lt;/WindowsFormsHost&gt;
  &lt;/StackPanel&gt;
  
  private void TextBox_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
  {
      e.Handled = true;
  }
  </code></pre>
  
  <p>Three textboxes, two WPF and one WinForm. I can't move focus between the two WPF-Textboxes which I desired but I can move focus to the WinForm-Textbox. The event <code>PreviewLostKeyboardFocus</code> does not even triggered when moving from a WPF-Textbox to a WinForm-Textbox. Any clues to why and how this could be solved?</p>
  
  <p>EDIT</p>
  
  <p>I've noticed that <code>WindowsFormsHost.PreviewGotKeyboardFocus</code> is triggered first when focus is leaving the WindowsFormsHost again. Thats odd. Maybe it's a bug?</p>