This documentation is archived and is not being maintained.

PointHitTestParameters Constructor

Initializes a new instance of the PointHitTestParameters class, using a Point.

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

public PointHitTestParameters(
	Point point
You cannot use constructors in XAML.


Type: System.Windows.Point

The parameter that is specified as the Point value.

The following example shows how to invoke HitTest by using a PointHitTestParameters value.

// Respond to the right mouse button down event by setting up a hit test results callback. 
private void OnMouseRightButtonDown(object sender, MouseButtonEventArgs e)
    // Retrieve the coordinate of the mouse position.
    Point pt = e.GetPosition((UIElement)sender);

    // Clear the contents of the list used for hit test results.

    // Set up a callback to receive the hit test result enumeration.
    VisualTreeHelper.HitTest(myCanvas, null,
        new HitTestResultCallback(MyHitTestResult),
        new PointHitTestParameters(pt));

    // Perform actions on the hit test results list. 
    if (hitResultsList.Count > 0)
        Console.WriteLine("Number of Visuals Hit: " + hitResultsList.Count);

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0