Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

IntersectionDetail Enumeration

Provides information about the intersection between the geometries in the GeometryHitTestParameters and the visual which was hit.

Namespace: System.Windows.Media
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public enum IntersectionDetail
public enum IntersectionDetail
public enum IntersectionDetail
<object property="EnumerationValue" .../>
 Member nameDescription
EmptyThe Geometry hit test parameter and the target visual, or geometry, do not intersect. 
FullyContainsThe Geometry hit test parameter is fully contained within the boundary of the target visual or geometry. 
FullyInsideThe target visual, or geometry, is fully inside the Geometry hit test parameter. 
IntersectsThe Geometry hit test parameter and the target visual, or geometry, intersect. This means that the two elements overlap, but neither element contains the other. 
NotCalculatedThe IntersectionDetail value is not calculated. 

The following illustration shows the relationship between the hit test geometry (the blue circle) and the visual geometry (the red square).

Intersection between hit test geometry and visual geometry during hit testing


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.
            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;
    }
}

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.