LosingFocusEventArgs LosingFocusEventArgs LosingFocusEventArgs LosingFocusEventArgs Class


Provides data for the FocusManager.LosingFocus and UIElement.LosingFocus events.

public : sealed class LosingFocusEventArgs : RoutedEventArgs
struct winrt::Windows::UI::Xaml::Input::LosingFocusEventArgs : RoutedEventArgs
public sealed class LosingFocusEventArgs : RoutedEventArgs
Public NotInheritable Class LosingFocusEventArgs Inherits RoutedEventArgs

Windows 10 requirements

Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)


Only a single UI element at a time can have focus.

A control can lose focus when another control gets focus, the application view changes, the user switches applications, or the user interacts with the system such that the application is no longer in the foreground.

Version history

Windows version SDK version Value added
1803 17134 TryCancel
1803 17134 TrySetNewFocusedElement
1809 17763 CorrelationId


Cancel Cancel Cancel Cancel

Gets or sets whether focus navigation should be canceled.

CorrelationId CorrelationId CorrelationId CorrelationId

Gets the unique ID generated when a focus movement event is initiated.

Direction Direction Direction Direction

Gets the direction that focus moved from element to element within the app UI.

FocusState FocusState FocusState FocusState

Gets the input mode through which an element obtained focus.

Handled Handled Handled Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along the event route from handling the same event again.

InputDevice InputDevice InputDevice InputDevice

Gets the input device type from which input events are received.

NewFocusedElement NewFocusedElement NewFocusedElement NewFocusedElement

Gets the most recent focused object.

OldFocusedElement OldFocusedElement OldFocusedElement OldFocusedElement

Gets the last focused object.

OriginalSource OriginalSource OriginalSource OriginalSource

Gets a reference to the object that raised the event. This is often a template part of a control rather than an element that was declared in your app UI.

(Inherited from RoutedEventArgs)


TryCancel() TryCancel() TryCancel() TryCancel()

Attempts to cancel the ongoing focus action.

TrySetNewFocusedElement(DependencyObject) TrySetNewFocusedElement(DependencyObject) TrySetNewFocusedElement(DependencyObject) TrySetNewFocusedElement(DependencyObject)

Attempts to redirect focus from the targeted element to the specified element.

See also