Table of Contents

Class InputExtensions

Namespace
Avalonia.Input
Assembly
Avalonia.Base.dll

Defines extensions for the IInputElement interface.

public static class InputExtensions
Inheritance
InputExtensions
Inherited Members

Methods

GetInputElementsAt(IInputElement, Point)

Returns the active input elements at a point on an IInputElement.

public static IEnumerable<IInputElement> GetInputElementsAt(this IInputElement element, Point p)

Parameters

element IInputElement

The element to test.

p Point

The point on element.

Returns

IEnumerable<IInputElement>

The active input elements found at the point, ordered topmost first.

GetInputElementsAt(IInputElement, Point, bool)

Returns the active input elements at a point on an IInputElement.

public static IEnumerable<IInputElement> GetInputElementsAt(this IInputElement element, Point p, bool enabledElementsOnly = true)

Parameters

element IInputElement

The element to test.

p Point

The point on element.

enabledElementsOnly bool

Whether to only return elements for which IsEffectivelyEnabled is true.

Returns

IEnumerable<IInputElement>

The active input elements found at the point, ordered topmost first.

InputHitTest(IInputElement, Point)

Returns the topmost active input element at a point on an IInputElement.

public static IInputElement? InputHitTest(this IInputElement element, Point p)

Parameters

element IInputElement

The element to test.

p Point

The point on element.

Returns

IInputElement

The topmost IInputElement at the specified position.

InputHitTest(IInputElement, Point, bool)

Returns the topmost active input element at a point on an IInputElement.

public static IInputElement? InputHitTest(this IInputElement element, Point p, bool enabledElementsOnly = true)

Parameters

element IInputElement

The element to test.

p Point

The point on element.

enabledElementsOnly bool

Whether to only return elements for which IsEffectivelyEnabled is true.

Returns

IInputElement

The topmost IInputElement at the specified position.

InputHitTest(IInputElement, Point, Func<Visual, bool>)

Returns the topmost active input element at a point on an IInputElement.

public static IInputElement? InputHitTest(this IInputElement element, Point p, Func<Visual, bool> filter)

Parameters

element IInputElement

The element to test.

p Point

The point on element.

filter Func<Visual, bool>

A filter predicate. If the predicate returns false then the visual and all its children will be excluded from the results.

Returns

IInputElement

The topmost IInputElement at the specified position.

InputHitTest(IInputElement, Point, Func<Visual, bool>, bool)

Returns the topmost active input element at a point on an IInputElement.

public static IInputElement? InputHitTest(this IInputElement element, Point p, Func<Visual, bool> filter, bool enabledElementsOnly = true)

Parameters

element IInputElement

The element to test.

p Point

The point on element.

filter Func<Visual, bool>

A filter predicate. If the predicate returns false then the visual and all its children will be excluded from the results.

enabledElementsOnly bool

Whether to only return elements for which IsEffectivelyEnabled is true.

Returns

IInputElement

The topmost IInputElement at the specified position.