FocusManager.LosingFocus FocusManager.LosingFocus FocusManager.LosingFocus FocusManager.LosingFocus Event


Occurs before focus moves from the current element with focus to the target element. This event is raised synchronously to ensure focus isn't moved while the event is bubbling.

public : event EventHandler<LosingFocusEventArgs> LosingFocus
// Register
event_token LosingFocus(EventHandler<LosingFocusEventArgs> const& handler) const;

// Revoke with event_token
void LosingFocus(event_token const& cookie) const;

// Revoke with event_revoker
LosingFocus_revoker LosingFocus(auto_revoke_t, EventHandler<LosingFocusEventArgs> const& handler) const;
public event EventHandler<LosingFocusEventArgs> LosingFocus
Public Event LosingFocus As EventHandler (Of LosingFocusEventArgs)
<uiElement LosingFocus="eventhandler"/>


We recommend using the UIElement focus routed events instead of FocusManager events whenever possible.

FocusNavigationDirection.Previous and FocusNavigationDirection.Next cannot be used with FindNextElementOptions. Only FocusNavigationDirection.Up, FocusNavigationDirection.Down, FocusNavigationDirection.Left, or FocusNavigationDirection.Right are supported.

UIElement focus events bubble up to the FocusManager in the following order:

  1. UIElement.LosingFocus /FocusManager.LosingFocus
  2. UIElement.GettingFocus /FocusManager.GettingFocus
  3. UIElement.LostFocus routed event is raised by the element that lost focus and the event bubbles up
  4. FocusManager.LostFocus is raised (even if the routed event is marked handled)
  5. UIElement.GotFocus routed event is raised by the element that received focus and the event bubbles up
  6. FocusManager.GotFocus is raised (even if the routed event is marked handled)

See also