Skip to main content

KeyboardNavigation Class

Definition​

Namespace:Avalonia.Input
Assembly:Avalonia.Base
Package:Avalonia

Defines attached properties that control keyboard navigation behaviour for a container.

public class KeyboardNavigation

Inheritance: object -> KeyboardNavigation

Methods​

GetIsTabStop Method​

Gets the Avalonia.Input.KeyboardNavigation.IsTabStopProperty for an element.

public bool GetIsTabStop(Avalonia.Input.InputElement element)

Parameters​

element Avalonia.Input.InputElement

The container.

Returns​

bool

Whether the container is a tab stop.

GetTabIndex Method​

Gets the Avalonia.Input.KeyboardNavigation.TabIndexProperty for an element.

public int GetTabIndex(Avalonia.Input.IInputElement element)

Parameters​

element Avalonia.Input.IInputElement

The container.

Returns​

int

The Avalonia.Input.KeyboardNavigationMode for the container.

GetTabNavigation Method​

Gets the Avalonia.Input.KeyboardNavigation.TabNavigationProperty for a container.

public Avalonia.Input.KeyboardNavigationMode GetTabNavigation(Avalonia.Input.InputElement element)

Parameters​

element Avalonia.Input.InputElement

The container.

Returns​

Avalonia.Input.KeyboardNavigationMode

The Avalonia.Input.KeyboardNavigationMode for the container.

GetTabOnceActiveElement Method​

Gets the Avalonia.Input.KeyboardNavigation.TabOnceActiveElementProperty for a container.

public Avalonia.Input.IInputElement GetTabOnceActiveElement(Avalonia.Input.InputElement element)

Parameters​

element Avalonia.Input.InputElement

The container.

Returns​

Avalonia.Input.IInputElement

The active element for the container.

SetIsTabStop Method​

Sets the Avalonia.Input.KeyboardNavigation.IsTabStopProperty for an element.

public void SetIsTabStop(Avalonia.Input.InputElement element, bool value)

Parameters​

element Avalonia.Input.InputElement

The container.

value bool

Value indicating whether the container is a tab stop.

SetTabIndex Method​

Sets the Avalonia.Input.KeyboardNavigation.TabIndexProperty for an element.

public void SetTabIndex(Avalonia.Input.IInputElement element, int value)

Parameters​

element Avalonia.Input.IInputElement

The element.

value int

The tab index.

SetTabNavigation Method​

Sets the Avalonia.Input.KeyboardNavigation.TabNavigationProperty for a container.

public void SetTabNavigation(Avalonia.Input.InputElement element, Avalonia.Input.KeyboardNavigationMode value)

Parameters​

element Avalonia.Input.InputElement

The container.

value Avalonia.Input.KeyboardNavigationMode

The Avalonia.Input.KeyboardNavigationMode for the container.

SetTabOnceActiveElement Method​

Sets the Avalonia.Input.KeyboardNavigation.TabOnceActiveElementProperty for a container.

public void SetTabOnceActiveElement(Avalonia.Input.InputElement element, Avalonia.Input.IInputElement value)

Parameters​

element Avalonia.Input.InputElement

The container.

value Avalonia.Input.IInputElement

The active element for the container.

Fields​

NameDescription
IsTabStopPropertyDefines the IsTabStop attached property.
TabIndexPropertyDefines the TabIndex attached property.
TabNavigationPropertyDefines the TabNavigation attached property.
TabOnceActiveElementPropertyDefines the TabOnceActiveElement attached property.

IsTabStopProperty Field​

Defines the IsTabStop attached property.

public Avalonia.AttachedProperty<TValue><bool> IsTabStopProperty

Remarks​

The IsTabStop attached property determines whether the control is focusable by tab navigation.

TabIndexProperty Field​

Defines the TabIndex attached property.

public Avalonia.AttachedProperty<TValue><int> TabIndexProperty

TabNavigationProperty Field​

Defines the TabNavigation attached property.

public Avalonia.AttachedProperty<TValue><Avalonia.Input.KeyboardNavigationMode> TabNavigationProperty

Remarks​

The TabNavigation attached property defines how pressing the Tab key causes focus to be navigated between the children of the container.

TabOnceActiveElementProperty Field​

Defines the TabOnceActiveElement attached property.

public Avalonia.AttachedProperty<TValue><Avalonia.Input.IInputElement> TabOnceActiveElementProperty

Remarks​

When focus enters a container which has its Avalonia.Input.KeyboardNavigation.TabNavigationProperty attached property set to Avalonia.Input.KeyboardNavigationMode.Once, this property defines to which child the focus should move.