public static void SetFocus(Control control) { if (control.Dispatcher.CheckAccess()) { control.Focus(); } else { control.Dispatcher.BeginInvoke(new SetFocusDelegate(SetFocus), control); } }