ContentElement.IsKeyboardFocusWithin 属性


获取一个值,该值指示键盘焦点是否位于元素或子元素内的任意位置。Gets a value that indicates whether keyboard focus is anywhere within the element or child elements.

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


如果键盘焦点在元素或其子元素上,则为 true;否则为 falsetrue if keyboard focus is on the element or its child elements; otherwise, false. 默认值为 falseThe default is false.



对此属性的值所做的更改通常引发 IsKeyboardFocusWithinChanged 事件,除非派生类已重写 OnIsKeyboardFocusWithinChanged 以禁止显示该事件。Changes to the value of this property typically raise the IsKeyboardFocusWithinChanged event, unless a derived class has overridden OnIsKeyboardFocusWithinChanged to suppress the event.

不会直接设置此属性,但可以通过调用 Focus或发出 MoveFocus 请求将焦点设置到元素。You do not set this property directly, but you can set the focus to the element by calling Focus, or by making a MoveFocus request. 这两种方法调用可能会更改此属性值。Either of these method calls might change this property value.

依赖项属性信息Dependency Property Information

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