If your application has multiple windows, the user can switch between the different windows. The sequence of events when switching from one window (1) to another (2) is as follows:
Window.Deactivated (#1)
Window.Activated (#2)
Window.PreviewLostKeyboardFocus (#1)
Window.PreviewGotKeyboardFocus (#2)
Window.IsKeyboardFocusWithinChanged (#1)
Window.IsKeyboardFocusWithinChanged (#2)
Window.IsKeyboardFocusChanged (#1)
Window.IsKeyboardFocusChanged (#2)
Window.LostKeyboardFocus (#1)
Window.GotKeyboardFocus (#2)
Window.Deactivated (#2)
Read more: 2,000 Things You Should Know About WPF
QR: