Table of Contents

Class KeyboardNavigationHandler

Namespace
Avalonia.Input
Assembly
Avalonia.Base.dll

Handles keyboard navigation for a window.

[Unstable]
public sealed class KeyboardNavigationHandler : IKeyboardNavigationHandler
Inheritance
KeyboardNavigationHandler
Implements
Inherited Members

Constructors

KeyboardNavigationHandler()

public KeyboardNavigationHandler()

Methods

GetNext(IInputElement, NavigationDirection)

Gets the next control in the specified navigation direction.

public static IInputElement? GetNext(IInputElement element, NavigationDirection direction)

Parameters

element IInputElement

The element.

direction NavigationDirection

The navigation direction.

Returns

IInputElement

The next element in the specified direction, or null if element was the last in the requested direction.

Move(IInputElement?, NavigationDirection, KeyModifiers)

Moves the focus in the specified direction.

public void Move(IInputElement? element, NavigationDirection direction, KeyModifiers keyModifiers = KeyModifiers.None)

Parameters

element IInputElement

The current element.

direction NavigationDirection

The direction to move.

keyModifiers KeyModifiers

Any key modifiers active at the time of focus.

SetOwner(IInputRoot)

Sets the owner of the keyboard navigation handler.

[PrivateApi]
public void SetOwner(IInputRoot owner)

Parameters

owner IInputRoot

The owner.

Remarks

This method can only be called once, typically by the owner itself on creation.