title: How to move focus in WPF?
body: <p>I wonder if there is anyway to change focus from the current control and move it to other control in WPF on TabIndex assigned controls.</p>
  
  <p>Example
  I have controls with TabIndex 1 to 5, is there a way to jumb the focus from 1 to 5 ?</p>
  
  <pre><code>&lt;TextBox TabIndex="1" Focusable = "true" LostFocus="test_LostFocus"/&gt;
  &lt;TextBox TabIndex="2" Focusable = "true"/&gt;
  ...
  &lt;TextBox TabIndex="5" Focusable = "true" name="LastControl"/&gt;
  </code></pre>
  
  <p>. </p>
  
  <pre><code>private void test_LostFocus(object sender, RoutedEventArgs e)
  {
    LastControl.Focus();
  }
  </code></pre>
  
  <p>I tried  <code>Keyboard.Focus()</code> and <code>FocusManager.SetFocusedElement()</code> but no luck.</p>
  
  <p>Any idea?</p>