This documentation is archived and is not being maintained.

GeometryHitTestResult.IntersectionDetail Property

Gets the IntersectionDetail value of the hit test.

Namespace: System.Windows.Media
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:

public IntersectionDetail IntersectionDetail { get; }
/** @property */
public IntersectionDetail get_IntersectionDetail ()

public function get IntersectionDetail () : IntersectionDetail

You cannot use this property in XAML.

Property Value

The IntersectionDetail value of the hit test.

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).

The intersection between a hit test geometry and a target object

Diagram of IntersectionDetail used in hit testing

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.

            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;

            return HitTestResultBehavior.Stop;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0