Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

FocusManager.GetFocusedElement Method

July 28, 2014

Queries the Windows Phone focus system to determine which object has focus.

Namespace:  System.Windows.Input
Assembly:  System.Windows (in System.Windows.dll)

public static Object GetFocusedElement()

Return Value

Type: System.Object
The object that currently has focus. Typically, this is a Control class.

GetFocusedElement can return null in certain cases. This might happen if there are no true Control class instances anywhere in the Windows Phone UI, or if the hosting browser does not have 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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2014 Microsoft