Export (0) Print
Expand All

FocusManager.GetFocusedElement Method (DependencyObject)

Gets the element with focus within the specified focus scope.

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

public static Object GetFocusedElement(
	DependencyObject element
)

Parameters

element
Type: System.Windows.DependencyObject
Declares the scope.

Return Value

Type: System.Object
The element in the specified focus scope that has current focus.

ExceptionCondition
ArgumentNullException

element cannot be null

Generally there is only a single focus scope in a Silverlight application. However, modal dialogs and popups can introduce additional focus scopes, in which case using the overload that enables specifying the scoping object might be necessary.

In the current implementation, passing an element parameter value that is not of type Window will result in a returned value of null.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft