Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.21 KB

focusmanager_getfocusedelement_1183614552.md

File metadata and controls

35 lines (22 loc) · 1.21 KB
-api-id -api-type ms.custom
M:Windows.UI.Xaml.Input.FocusManager.GetFocusedElement
winrt method
19H1

Windows.UI.Xaml.Input.FocusManager.GetFocusedElement

-description

Retrieves the element in the UI that has focus.

-returns

The object that has focus. Typically, this is a Control class.

-remarks

Warning

For WinUI 3 apps, this method always returns null as it relies on CoreWindow APIs not supported by WinUI 3.

Instead, use the FocusManager.GetFocusedElement(XamlRoot) overload, where XamlRoot can be retrieved any loaded UIElement through the XamlRoot property.

-examples

-see-also

GetFocusedElement, Keyboard interactions, Focus navigation for keyboard, gamepad, remote control, and accessibility tools, Programmatic focus navigation