PointHitTestParameters.HitPoint Propriété

Définition

Obtient le Point par rapport auquel effectuer le test d'atteinte.

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

Valeur de propriété

Point

Point par rapport auquel effectuer le test d'atteinte.

Exemples

L’exemple suivant montre comment remplacer la prise en charge des tests d’accès par défaut dans un objet visuel défini par l’utilisateur. Dans ce cas, la HitPoint valeur est simplement retournée dans le cadre de 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

S’applique à