Skip to main content

FindNextElementOptions Class

Definition​

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

Provides options to customize the behavior when identifying the next element to focus during a navigation operation.

public class FindNextElementOptions

Inheritance: object -> FindNextElementOptions

Constructors​

NameDescription
FindNextElementOptionsNo summary available.

FindNextElementOptions Constructor​

public FindNextElementOptions()

Properties​

NameDescription
ExclusionRectGets or sets the rectangular region within the visual hierarchy that will be excluded from consideration during focus navigation.
FocusedElementGets or sets the element that will be treated as the starting point of the search for the next focusable element. This does not need to be the element that is currently focused. If null, Avalonia.Input.FocusManager.GetFocusedElement is used.
FocusHintRectangleGets or sets a rectangular region that serves as a hint for focus navigation. This property specifies a rectangle, relative to the coordinate system of the search root, which can be used as a preferred or prioritized target when navigating focus. It can be null if no specific hint region is provided.
IgnoreOcclusivitySpecifies whether occlusivity (overlapping of elements or obstructions) should be ignored during focus navigation. When set to true, the navigation logic disregards obstructions that may block a potential focus target, allowing elements behind such obstructions to be considered.
NavigationStrategyOverrideSpecifies an optional override for the navigation strategy used in XY focus navigation. This property allows customizing the focus movement behavior when navigating between UI elements.
SearchRootGets or sets the root Avalonia.Input.InputElement within which the search for the next focusable element will be conducted.

ExclusionRect Property​

Gets or sets the rectangular region within the visual hierarchy that will be excluded from consideration during focus navigation.

public Avalonia.Rect ExclusionRect { get; set; }

Remarks​

This option is only used with Avalonia.Input.NavigationDirection.Up, Avalonia.Input.NavigationDirection.Down, Avalonia.Input.NavigationDirection.Left, and Avalonia.Input.NavigationDirection.Right. It is ignored for other directions.

FocusedElement Property​

Gets or sets the element that will be treated as the starting point of the search for the next focusable element. This does not need to be the element that is currently focused. If null, Avalonia.Input.FocusManager.GetFocusedElement is used.

public Avalonia.Input.IInputElement FocusedElement { get; set; }

FocusHintRectangle Property​

Gets or sets a rectangular region that serves as a hint for focus navigation. This property specifies a rectangle, relative to the coordinate system of the search root, which can be used as a preferred or prioritized target when navigating focus. It can be null if no specific hint region is provided.

public Nullable<Avalonia.Rect> FocusHintRectangle { get; set; }

Remarks​

This option is only used with Avalonia.Input.NavigationDirection.Up, Avalonia.Input.NavigationDirection.Down, Avalonia.Input.NavigationDirection.Left, and Avalonia.Input.NavigationDirection.Right. It is ignored for other directions.

IgnoreOcclusivity Property​

Specifies whether occlusivity (overlapping of elements or obstructions) should be ignored during focus navigation. When set to true, the navigation logic disregards obstructions that may block a potential focus target, allowing elements behind such obstructions to be considered.

public bool IgnoreOcclusivity { get; set; }

Remarks​

This option is only used with Avalonia.Input.NavigationDirection.Up, Avalonia.Input.NavigationDirection.Down, Avalonia.Input.NavigationDirection.Left, and Avalonia.Input.NavigationDirection.Right. It is ignored for other directions.

Specifies an optional override for the navigation strategy used in XY focus navigation. This property allows customizing the focus movement behavior when navigating between UI elements.

public Nullable<Avalonia.Input.XYFocusNavigationStrategy> NavigationStrategyOverride { get; set; }

Remarks​

This option is only used with Avalonia.Input.NavigationDirection.Up, Avalonia.Input.NavigationDirection.Down, Avalonia.Input.NavigationDirection.Left, and Avalonia.Input.NavigationDirection.Right. It is ignored for other directions.

SearchRoot Property​

Gets or sets the root Avalonia.Input.InputElement within which the search for the next focusable element will be conducted.

public Avalonia.Input.InputElement SearchRoot { get; set; }

Remarks​

This property defines the boundary for focus navigation operations. It determines the root element in the visual tree under which the focusable item search is performed. If not specified, the search will default to the current scope.

This option is only used with Avalonia.Input.NavigationDirection.Up, Avalonia.Input.NavigationDirection.Down, Avalonia.Input.NavigationDirection.Left, and Avalonia.Input.NavigationDirection.Right. It is ignored for other directions.