Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PointHitTestParameters.HitPoint Property

 

Gets the Point against which to hit test.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public Point HitPoint { get; }

Property Value

Type: System.Windows.Point

The Point against which to hit test.

The following example shows how to override default hit test support in a user-defined visual object. In this case, the HitPoint value is simply returned as part of PointHitTestResult.

// Override default hit test support in visual object.
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters)
{
    Point pt = hitTestParameters.HitPoint;

    // Perform custom actions during the hit test processing,
    // which may include verifying that the point actually
    // falls within the rendered content of the visual.

    // Return hit on bounding rectangle of visual object.
    return new PointHitTestResult(this, pt);
}

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft