GeometryHitTestResult.IntersectionDetail Eigenschaft

Definition

Ruft den IntersectionDetail-Wert des Treffertests ab.

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

Eigenschaftswert

IntersectionDetail

Der IntersectionDetail-Wert des Treffertests.

Beispiele

Im folgenden Beispiel wird gezeigt, wie Sie die IntersectionDetail Eigenschaft von 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

Hinweise

Die IntersectionDetail Eigenschaft beschreibt die Schnittmenge zwischen einem Geometry und dem visuellen Zielobjekt.

Die folgende Abbildung zeigt die Beziehung zwischen der Treffertestgeometrie (blauem Kreis) und dem Zielobjekt (das rote Quadrat).

Diagramm von IntersectionDetail bei Treffertests
Die Schnittmenge zwischen einer Treffertestgeometrie und einem Zielobjekt

Gilt für