UIElement.IsStylusDirectlyOver UIElement.IsStylusDirectlyOver UIElement.IsStylusDirectlyOver UIElement.IsStylusDirectlyOver Property


获取一个值,该值指示在考虑元素组合的情况下,触笔的位置是否与命中测试结果相对应。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.

 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不同的是, 仅true当触笔位于元素上时, 此属性才适用。Unlike IsStylusOver, this property is only true if the stylus is over the element. 如果触笔位于某个子元素上或作为元素的更深层合成 (可视化树) 一部分的元素, 则此属性将为falseIf 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. 对于不是创作控件的大多数情况, 请IsStylusOver改用。For 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