title: WPF Reset Focus on Button Click
body: <p>I have a <code>TextBox</code> and a <code>ToolBar</code> with a <code>Button</code>.  If I'm typing in the <code>TextBox</code> and I click the <code>Button</code> I want the <code>TextBox</code> to lose <code>Focus</code> so the binding gets updated. I don't want to add a <code>UpdateSourceTrigger=PropertyChanged</code> to my <code>TextBox</code>. But instead when I click on the <code>Button</code> I reset <code>Focus</code> to the main window so what ever I'm on loses <code>Focus</code> and updates the bindings.</p>
  
  <p>I've tried adding a <code>OnClick</code> to the button with the following, but it doesn't seem to work:</p>
  
  <pre><code>    private void Button_Click(object sender, RoutedEventArgs e) {
          FocusManager.SetFocusedElement(this, null);
      }
  </code></pre>
  
  <p>Any tips would be appreciated.</p>
  
  <p>Thanks,
  Raul</p>