Skip to main content

ICustomHitTest Interface

Definition​

Assembly:Avalonia.Base
Package:Avalonia

Allows hit-testing to use a custom area instead of the area of the rendered content.

public interface ICustomHitTest

Methods​

NameDescription
HitTest (2 overloads)Determines how geometry intersects the hit-test area.

HitTest overloads​

HitTest Method​

Determines how geometry intersects the hit-test area.

public Avalonia.Media.IntersectionResult HitTest(Avalonia.Media.Geometry geometry)
Parameters​

geometry Avalonia.Media.Geometry

The geometry to hit test, mapped to local coordinate space.

Returns​

Avalonia.Media.IntersectionResult

An Avalonia.Media.IntersectionResult describing how the geometry and the hit-test area intersect.

Remarks​

Does not hit test children. Test manually if you need children to be tested.

HitTest Method​

Determines whether a point is within the hit-test area.

public bool HitTest(Avalonia.Point point)
Parameters​

point Avalonia.Point

The point to hit test in local coordinate space, i.e., (0, 0) is the top-left corner of the visual element, not the top-left corner of the window.

Returns​

bool

On this page