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

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft