语言

Stylus.GetIsPressAndHoldEnabled(DependencyObject) 方法

定义

获取指定元素上的附加属性的值 IsPressAndHoldEnabled 。

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

参数

element
DependencyObject

用于确定是否启用按下和按住的 A UIElement 或 ContentElement 依据。

返回

true 如果指定的元素已启用,则为 ;如果指定的元素已启用,则为 ;否则,为 false.

特性

示例

以下示例演示如何启用按住 Slidera. 此示例假定有一个 Slider 调用 horizontalSlider1。

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

适用于