Sdílet prostřednictvím


FocusHelper Class

Definition

Microsoft internal use only. Manages focus tasks.

public ref class FocusHelper abstract sealed
public ref class FocusHelper abstract sealed
class FocusHelper abstract sealed
public static class FocusHelper
type FocusHelper = class
Public Class FocusHelper
Inheritance
FocusHelper

Fields

AllowModalMoveFocusProperty

A depedency property that allows elements to skip the modal check during MoveFocusInto calls.

EnableActivationSynchronizationProperty

A dependency property that allows you to get or set a value indicating whether the specified control wants to participate in focus restoration during window activation.

FocusTargetProperty

Gets or sets a focus target for an element. The focus target is automatically focused whenever the DependencyObject the target is attached to receives direct keyboard focus.

Attached Properties

AllowModalMoveFocus
EnableActivationSynchronization
FocusTarget

Gets the focus target for an element.

Methods

FocusPossiblyUnloadedElement(FrameworkElement)

Either sends focus to the FrameworkElement immediately using Focus, or delays focusing the FrameworkElement until it is loaded. The last element pending focus on Loaded will be focused, and all previous FrameworkElements will not be focused.

GetAllowModalMoveFocus(UIElement)

Gets a value indicating whether the specified control wants to skip the modal check during MoveFocusInto calls.

GetEnableActivationSynchronization(UIElement)

Gets a value indicating whether the specified control wants to participate in focus restoration when it has focus during window activation.

GetFocusTarget(UIElement)

Gets the focus target for an element. The focus target is automatically focused whenever the DependencyObject the target is attached to receives direct keyboard focus.

IsKeyboardFocusWithin(IntPtr)

Determines if Win32 keyboard focus is within an HWND.

IsKeyboardFocusWithin(UIElement)

Determines if WPF or Win32 keyboard focus is within a UIElement.

MoveFocusInto(UIElement)

Uses the UIElement.MoveFocus method to try to move WPF focus to the first valid focusable element inside the given UIElement, after first ensuring that WPF will not attempt to change focus because of a cross-HwndSource focus change.

If UIElement.MoveFocus fails to move focus into the element, focus will be cleared by invoking Keyboard.ClearFocus to clear WPF focus, and by using SetFocus to focus the HWND of HwndSource containing the element.

SetAllowModalMoveFocus(UIElement, Boolean)

Sets a value indicating whether the specified control wants to skip the modal check during MoveFocusInto calls.

SetEnableActivationSynchronization(UIElement, Boolean)

Sets a value indicating whether the specified control wants to participate in focus restoration when it has focus during window activation.

SetFocusTarget(UIElement, UIElement)

Sets the focus target for an element. The focus target is automatically focused whenever the DependencyObject the target is attached to receives direct keyboard focus.

Applies to