FocusManager Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Provides utility methods related to element focus, without the need to handle focus-related events.
Assembly: System.Windows (in System.Windows.dll)
The FocusManager type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | GetFocusedElement | Queries the Windows Phone focus system to determine which object has focus. |
Windows Phone focus has the characteristic that while the focus-reporting events GotFocus and LostFocus are raised asynchronously, the focus returned by GetFocusedElement is determined synchronously. This design attempts to loosen constraints on runtime adjustments to element trees that could result from having to wait for the focus to be determined and moved. For cases where determining the synchronous focus is critical, use the GotFocus and LostFocus events as a cue, but then call FocusManager::GetFocusedElement to verify the synchronous focus.

