Example #1
0
        private void SendTrackFocusEvent(TrackFocusEventArgs e)
        {
            EventHandler <TrackFocusEventArgs> eventHandler = this._trackFocusDelegate;

            if (eventHandler == null)
            {
                return;
            }
            eventHandler((object)this, e);
        }
Example #2
0
 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);
     }
 }