GeometryHitTestResult(Visual, IntersectionDetail) Constructor

Definition

Initializes a new instance of the GeometryHitTestResult class by using a specified visual object and IntersectionDetail value.

C#
public GeometryHitTestResult(System.Windows.Media.Visual visualHit, System.Windows.Media.IntersectionDetail intersectionDetail);

Parameters

visualHit
Visual

The visual object that is hit during a hit test.

intersectionDetail
IntersectionDetail

Describes the intersection between a Geometry and visualHit.

Examples

The following example shows how to create a GeometryHitTestResult object and use it as a return value for an overridden implementation of HitTestCore.

C#
// Override default hit test support in visual object.
protected override GeometryHitTestResult HitTestCore(GeometryHitTestParameters hitTestParameters)
{
    IntersectionDetail intersectionDetail = IntersectionDetail.NotCalculated;

    // Perform custom actions during the hit test processing.

    return new GeometryHitTestResult(this, intersectionDetail);
}

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9