Język

Stylus.GetIsPressAndHoldEnabled(DependencyObject) Metoda

Definicja

Pobiera wartość dołączonej IsPressAndHoldEnabled właściwości dla określonego elementu.

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

A UIElement lub ContentElement , na którym należy określić, czy naciśnięcie i blokada jest włączona.

Zwraca

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

Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak włączyć naciśnięcie i przytrzymanie klawisza Slider. W tym przykładzie przyjęto założenie, ż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