FocusManager Class
namespace Noesis | MSDN
Provides a set of static methods, attached properties, and events for determining and setting focus scopes and for setting the focused element within the scope.
There are two concepts concerning focus: keyboard focus and logical focus.
Keyboard focus pertains to the element that is currently receiving keyboard input. There can be only one element with keyboard focus. This element with keyboard focus has IsKeyboardFocused set to true. Keyboard.FocusedElement returns the element with keyboard focus.
Logical focus pertains to the FocusManager.FocusedElement within a specific focus scope.
There can be multiple elements with logical focus, but there can only be one element with logical focus within a single focus scope. An element with logical focus does not necessarily have keyboard focus, but an element with keyboard focus will have logical focus. It is possible to define a focus scope within a focus scope. In this case, both the parent focus scope and the child focus scope can have a FocusManager.FocusedElement.
Properties
FocusManager has no properties
Methods
Name | Description |
---|---|
AddGotFocusHandler | Adds a handler for the GotFocus attached event |
AddLostFocusHandler | Adds a handler for the LostFocus attached event |
GetFocusScope | Determines the closest ancestor of the specified element that has IsFocusScope set to true |
GetFocusedElement | Gets the element with logical focus within the specified focus scope. Attached property |
GetIsFocusScope | Determines whether the specified DependencyObject is a focus scope. Attached property |
RemoveGotFocusHandler | Removes a handler for the GotFocus attached event |
RemoveLostFocusHandler | Removes a handler for the LostFocus attached event |
SetFocusedElement | Sets the element with logical focus within the specified focus scope. Attached property |
SetIsFocusScope | Specifies if the given DependencyObject is a focus scope. Attached property |