Determines whether to continue the enumeration of any remaining visual objects during a hit test.
Assembly: PresentationCore (in PresentationCore.dll)
A hit test results callback method defines the actions that you perform when a hit test is identified on a particular visual object in the visual tree. After you perform the actions, you return a value that determines whether to continue the enumeration of any other visual objects.
You can enumerate all visual objects in a visual tree whose geometry contains a specified coordinate value. By returning in your hit test callback method, you can identify all visual objects that are hit, even those that may be partly or wholly obscured by other visual objects.
The following example shows how to return a value from a hit test results callback method.
' Return the result of the hit test to the callback. Public Function MyHitTestResult(ByVal result As HitTestResult) As HitTestResultBehavior ' Add the hit test result to the list that will be processed after the enumeration. hitResultsList.Add(result.VisualHit) ' Set the behavior to return visuals at all z-order levels. Return HitTestResultBehavior.Continue End Function
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.