GeometryHitTestResult.IntersectionDetail GeometryHitTestResult.IntersectionDetail GeometryHitTestResult.IntersectionDetail GeometryHitTestResult.IntersectionDetail Property

定義

ヒット テストの IntersectionDetail 値を取得します。Gets the IntersectionDetail value of the hit test.

public:
 property System::Windows::Media::IntersectionDetail IntersectionDetail { System::Windows::Media::IntersectionDetail get(); };
public System.Windows.Media.IntersectionDetail IntersectionDetail { get; }
member this.IntersectionDetail : System.Windows.Media.IntersectionDetail
Public ReadOnly Property IntersectionDetail As IntersectionDetail

プロパティ値

次の例は、使用する方法を示します、IntersectionDetailプロパティのGeometryHitTestResultします。The following example shows how to use the IntersectionDetail property of GeometryHitTestResult.

// Return the result of the hit test to the callback.
public HitTestResultBehavior MyHitTestResultCallback(HitTestResult result)
{
    // Retrieve the results of the hit test.
    IntersectionDetail intersectionDetail = ((GeometryHitTestResult)result).IntersectionDetail;

    switch (intersectionDetail)
    {
        case IntersectionDetail.FullyContains:

            // Add the hit test result to the list that will be processed after the enumeration.
            hitResultsList.Add(result.VisualHit);

            return HitTestResultBehavior.Continue;

        case IntersectionDetail.Intersects:

            // Set the behavior to return visuals at all z-order levels.
            return HitTestResultBehavior.Continue;

        case IntersectionDetail.FullyInside:

            // Set the behavior to return visuals at all z-order levels.
            return HitTestResultBehavior.Continue;

        default:
            return HitTestResultBehavior.Stop;
    }
}
' Return the result of the hit test to the callback.
Public Function MyHitTestResultCallback(ByVal result As HitTestResult) As HitTestResultBehavior
	' Retrieve the results of the hit test.
	Dim intersectionDetail As IntersectionDetail = (CType(result, GeometryHitTestResult)).IntersectionDetail

	Select Case intersectionDetail
		Case IntersectionDetail.FullyContains

			' Add the hit test result to the list that will be processed after the enumeration.
			hitResultsList.Add(result.VisualHit)

			Return HitTestResultBehavior.Continue

		Case IntersectionDetail.Intersects

			' Set the behavior to return visuals at all z-order levels.
			Return HitTestResultBehavior.Continue

		Case IntersectionDetail.FullyInside

			' Set the behavior to return visuals at all z-order levels.
			Return HitTestResultBehavior.Continue

		Case Else
			Return HitTestResultBehavior.Stop
	End Select
End Function

注釈

IntersectionDetail交差部分を記述するプロパティをGeometryと対象のビジュアル オブジェクト。The IntersectionDetail property describes the intersection between a Geometry and the target visual object.

次の図は、ヒット テストのジオメトリ (青い円) とターゲット オブジェクト (赤い正方形) 間のリレーションシップを示します。The following illustration shows the relationship between the hit test geometry (the blue circle) and the target object (the red square).

ヒット テストで使用される IntersectionDetail のダイアグラムDiagram of IntersectionDetail used in hit testing
ヒット テストのジオメトリと対象のオブジェクトの交差部分The intersection between a hit test geometry and a target object

適用対象