UIElement.IsVisible Property


获取一个值,该值指示此元素在用户界面 (UI)user interface (UI) 中是否可见。Gets a value indicating whether this element is visible in the 用户界面 (UI)user interface (UI). 这是依赖项属性。This is a dependency property.

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

Property Value


如果该元素可见,则为 true;否则为 falsetrue if the element is visible; otherwise, false.


确定 IsVisible 值将考虑布局的所有因素。Determination of the IsVisible value takes all factors of layout into account. 相反,Visibility,这是一个可设置的属性,只指示以编程方式使元素可见或不可见的意图。In contrast, Visibility, which is a settable property, only indicates the intention to programmatically make an element visible or invisible.

如果 IsVisible false 的元素不参与输入事件(或命令),则不会影响布局的度量值或排列处理过程、不可获得焦点、不在 tab 序列中,并且不会在命中测试中报告。Elements where IsVisible is false do not participate in input events (or commands), do not influence either the measure or arrange passes of layout, are not focusable, are not in a tab sequence, and will not be reported in hit testing. 相反,IsEnabled false 的元素仍将参与事件和命令,并进行命中测试,但也不能获得焦点。In contrast, elements where IsEnabled is false will still participate in events and commands, and hit testing, but are also not focusable.

依赖项属性信息Dependency Property Information

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

Applies to