GeometryHitTestResult(Visual, IntersectionDetail) Constructor

Definition

使用指定的可视对象和 GeometryHitTestResult 值初始化 IntersectionDetail 类的新实例。Initializes a new instance of the GeometryHitTestResult class by using a specified visual object and IntersectionDetail value.

public:
 GeometryHitTestResult(System::Windows::Media::Visual ^ visualHit, System::Windows::Media::IntersectionDetail intersectionDetail);
public GeometryHitTestResult (System.Windows.Media.Visual visualHit, System.Windows.Media.IntersectionDetail intersectionDetail);
new System.Windows.Media.GeometryHitTestResult : System.Windows.Media.Visual * System.Windows.Media.IntersectionDetail -> System.Windows.Media.GeometryHitTestResult
Public Sub New (visualHit As Visual, intersectionDetail As IntersectionDetail)

Parameters

visualHit
Visual

在命中测试期间命中的可视对象。The visual object that is hit during a hit test.

intersectionDetail
IntersectionDetail

描述 GeometryvisualHit 之间的交集。Describes the intersection between a Geometry and visualHit.

Examples

下面的示例演示如何创建 GeometryHitTestResult 对象,并将其用作 HitTestCore的重写实现的返回值。The following example shows how to create a GeometryHitTestResult object and use it as a return value for an overridden implementation of HitTestCore.

// 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);
}
' Override default hit test support in visual object.
Protected Overrides Overloads Function HitTestCore(ByVal hitTestParameters As GeometryHitTestParameters) As GeometryHitTestResult
    Dim intersectionDetail As IntersectionDetail = IntersectionDetail.NotCalculated

    ' Perform custom actions during the hit test processing.

    Return New GeometryHitTestResult(Me, intersectionDetail)
End Function

Applies to