UIElement.IsStylusDirectlyOver 属性

定义

获取一个值,该值指示在考虑元素组合的情况下,触笔的位置是否与命中测试结果相对应。Gets a value that indicates whether the stylus position corresponds to hit test results, which take element compositing into account. 这是依赖项属性。This is a dependency property.

public:
 property bool IsStylusDirectlyOver { bool get(); };
public bool IsStylusDirectlyOver { get; }
member this.IsStylusDirectlyOver : bool
Public ReadOnly Property IsStylusDirectlyOver As Boolean

属性值

如果触笔指针位于与命中测试相同的元素结果上,则为 true;否则为 falsetrue if the stylus pointer is over the same element result as a hit test; otherwise, false. 默认值为 falseThe default is false.

实现

注解

IsStylusOver不同,此属性仅在触笔位于元素上时 trueUnlike IsStylusOver, this property is only true if the stylus is over the element. 如果触笔位于某个子元素上或作为元素的更深层组合(可视化树)一部分的元素,则将 false此属性。If the stylus is instead over a child element or over elements that are part of an element's deeper compositing (the visual tree), this property will be false.

除非您知道控件的组合方式(例如,在自定义控件模板中对您定义的控件使用此属性),否则此属性可能会返回意外的结果。Unless you know how a control is composited (for example, you use this property in a custom control template for a control that you define), this property might return unexpected results. 对于不是创作控件的大多数情况,请改用 IsStylusOverFor most scenarios where you are not authoring controls, use IsStylusOver instead.

如果此元素具有触笔捕获,而此属性在捕获时 true,则此属性将保持 true,直到触笔捕获丢失并且触笔不在其边界上。If this element has stylus capture and this property is true at the time of capture, this property remains true until stylus capture is lost and the stylus is not over its bounds.

触摸、鼠标和触笔输入在特定关系中存在。Touch, mouse, and stylus input exist in a particular relationship. 有关详细信息,请参阅输入概述For more information, see Input Overview.

依赖项属性信息Dependency Property Information

标识符字段Identifier field IsStylusDirectlyOverProperty
元数据属性设置为 trueMetadata properties set to true NoneNone

适用于

另请参阅