Bagikan melalui


IntersectionDetail Enum

Definisi

Menyediakan informasi tentang persimpangan antara geometri di GeometryHitTestParameters dan visual yang terpukul.

public enum class IntersectionDetail
public enum IntersectionDetail
type IntersectionDetail = 
Public Enum IntersectionDetail
Warisan
IntersectionDetail

Bidang

Nama Nilai Deskripsi
NotCalculated 0

Nilai IntersectionDetail tidak dihitung.

Empty 1

Parameter Geometry pengujian hit dan visual target, atau geometri, tidak berpotangan.

FullyInside 2

Visual target, atau geometri, sepenuhnya berada di dalam Geometry parameter pengujian hit.

FullyContains 3

Parameter Geometry uji hit sepenuhnya terkandung dalam batas visual target atau geometri.

Intersects 4

Parameter Geometry pengujian hit dan visual target, atau geometri, berpotangan. Ini berarti bahwa dua elemen tumpang tindih, tetapi tidak ada elemen yang berisi yang lain.

Contoh

Contoh berikut menunjukkan cara menggunakan IntersectionDetail properti .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

Keterangan

Ilustrasi berikut menunjukkan hubungan antara geometri uji hit (lingkaran biru) dan geometri visual (persegi merah).

Diagram IntersectionDetail yang digunakan dalam pengujian hit Persimpangan antara geometri uji tekan dan geometri visual selama pengujian hit

Berlaku untuk