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