Visual.HitTestCore Method (GeometryHitTestParameters)
Determines whether a geometry value is within the bounds of the visual object.
Assembly: PresentationCore (in PresentationCore.dll)
'Declaration Protected Overridable Function HitTestCore ( _ hitTestParameters As GeometryHitTestParameters _ ) As GeometryHitTestResult
You can override default hit testing support for a visual object by overriding the HitTestCore method. This means that when you invoke the HitTest method, your overridden implementation of HitTestCore is called. Your overridden method is called when a hit test falls within the bounding rectangle of the visual object, even if the coordinate falls outside the geometry of the visual object.
The following example shows how to override the method. One reason you might want to override this method is to provide additional functionality during the hit testing process.
' Override default hit test support in visual object. Protected Overrides Overloads Function HitTestCore(ByVal hitTestParameters As GeometryHitTestParameters) As GeometryHitTestResult Dim intersectionDetail As IntersectionDetail = IntersectionDetail.NotCalculated ' Perform custom actions during the hit test processing. Return New GeometryHitTestResult(Me, intersectionDetail) 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.