title: Set focus to UI element using XAML or MVVM
body: <p>I want to set focus to the ui element(ui element is popup which contains devexpress grid) when I press down arrow  key in the text box. I would like it to work purely on XAML side or by using MVVM. will this work. pls let me know the way i can accomplish this.</p>
  
  <pre><code>&lt;KeyBinding Key="Down" FocusManager.FocusedElement="{Binding ElementName=PART_GridControl}"/&gt;
  </code></pre>
  
  <p>i was using code behind like this but i want to implement mvvm.i want to change the focus from text box to the grid control, when i press down arrow key in text box – </p>
  
  <pre><code> private void text_KeyDown(object sender, KeyEventArgs e)
   {
       if (e.Key == Key.Down || e.Key == Key.Up || e.Key == Key.Left || e.Key == Key.Right)
       {
          PART_GridControl.Focus();
       }      
   }
  </code></pre>