private void SendTrackFocusEvent(TrackFocusEventArgs e) { EventHandler <TrackFocusEventArgs> eventHandler = this._trackFocusDelegate; if (eventHandler == null) { return; } eventHandler((object)this, e); }
private void OnTrackFocus(object sender, TrackFocusEventArgs e) { if (this.IsSelfOrDescendentWindow(e.HwndGainFocus)) { if (!this._takingWin32Focus && Keyboard.FocusedElement != this && !this.IsSelfOrDescendentWindow(e.HwndLoseFocus)) { this.SetFocusToHwndHost(false, e.HwndGainFocus); return; } } else if (e.HwndGainFocus != IntPtr.Zero && this.IsSelfOrDescendentWindow(e.HwndLoseFocus) && !this._takingWpfFocus && this._hwndSource != null && e.HwndGainFocus == this._hwndSource.Handle && this._hwndSource.RootVisual != null) { FocusManager.SetFocusedElement(this._hwndSource.RootVisual, null); } }