PointHitTestParameters.HitPoint Właściwość

Definicja

Pobiera element, Point do którego należy trafić test.

public:
 property System::Windows::Point HitPoint { System::Windows::Point get(); };
public System.Windows.Point HitPoint { get; }
member this.HitPoint : System.Windows.Point
Public ReadOnly Property HitPoint As Point

Wartość właściwości

Przeciwko Point któremu należy trafić test.

Przykłady

W poniższym przykładzie pokazano, jak zastąpić domyślną obsługę testów trafień w obiekcie wizualizacji zdefiniowanym przez użytkownika. W tym przypadku HitPoint wartość jest po prostu zwracana jako część PointHitTestResult.

// Override default hit test support in visual object.
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters)
{
    Point pt = hitTestParameters.HitPoint;

    // Perform custom actions during the hit test processing,
    // which may include verifying that the point actually
    // falls within the rendered content of the visual.

    // Return hit on bounding rectangle of visual object.
    return new PointHitTestResult(this, pt);
}
' Override default hit test support in visual object.
Protected Overrides Overloads Function HitTestCore(ByVal hitTestParameters As PointHitTestParameters) As HitTestResult
    Dim pt As Point = hitTestParameters.HitPoint

    ' Perform custom actions during the hit test processing,
    ' which may include verifying that the point actually
    ' falls within the rendered content of the visual.

    ' Return hit on bounding rectangle of visual object.
    Return New PointHitTestResult(Me, pt)
End Function

Dotyczy