FocusHelper.MoveFocusInto Method
Uses the MoveFocus method to try to move WPF focus to the first valid focusable element inside the given UIElement, after first enduring that WPF will not attempt to change focus because of a cross- HwndSource focus change.
Namespace: Microsoft.VisualStudio.PlatformUI
Assembly: Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
Syntax
'Declaration
Public Shared Sub MoveFocusInto ( _
element As UIElement _
)
public static void MoveFocusInto(
UIElement element
)
public:
static void MoveFocusInto(
UIElement^ element
)
static member MoveFocusInto :
element:UIElement -> unit
public static function MoveFocusInto(
element : UIElement
)
Parameters
element
Type: UIElementThe element to move focus into.
Remarks
If MoveFocus fails to move focus into the element, focus will be cleared by invoking ClearFocus to clear WPF focus and using SetFocus to focus the HWND of the HwndSource containing the element.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.