GeometryHitTestResult(Visual, IntersectionDetail) 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的可视对象和 GeometryHitTestResult 值初始化 IntersectionDetail 类的新实例。
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)
参数
- visualHit
- Visual
在命中测试期间命中的可视对象。
- intersectionDetail
- IntersectionDetail
描述 Geometry 和 visualHit
之间的交集。
示例
以下示例演示如何创建对象 GeometryHitTestResult 并将其用作重写实现的 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