Stylus.GetIsPressAndHoldEnabled(DependencyObject) Metoda

Definicja

Pobiera wartość dołączonej IsPressAndHoldEnabled właściwości w określonym elemecie.

public:
 static bool GetIsPressAndHoldEnabled(System::Windows::DependencyObject ^ element);
[System.Windows.AttachedPropertyBrowsableForType(typeof(System.Windows.DependencyObject))]
public static bool GetIsPressAndHoldEnabled (System.Windows.DependencyObject element);
[<System.Windows.AttachedPropertyBrowsableForType(typeof(System.Windows.DependencyObject))>]
static member GetIsPressAndHoldEnabled : System.Windows.DependencyObject -> bool
Public Shared Function GetIsPressAndHoldEnabled (element As DependencyObject) As Boolean

Parametry

element
DependencyObject

Element UIElement lub ContentElement , na którym można określić, czy jest włączone naciśnięcie i blokada.

Zwraca

true jeśli określony element ma włączone naciśnięcie i przytrzymaj; w przeciwnym razie , false.

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak włączyć naciśnięcie i zatrzymanie na obiekcie Slider. W tym przykładzie założono, że istnieje Slider nazwa .horizontalSlider1

if (!Stylus.GetIsPressAndHoldEnabled(horizontalSlider1))
{
    Stylus.SetIsPressAndHoldEnabled(horizontalSlider1, true);
}
If Not Stylus.GetIsPressAndHoldEnabled(horizontalSlider1) Then
    Stylus.SetIsPressAndHoldEnabled(horizontalSlider1, True)
End If

Dotyczy