FrameworkElement.IsInitialized 属性
定义
public:
property bool IsInitialized { bool get(); };
public bool IsInitialized { get; }
member this.IsInitialized : bool
Public ReadOnly Property IsInitialized As Boolean
属性值
如果该元素按照前面提到的 XAMLXAML 处理或者方法调用已被初始化,则为 true
;否则为 false
。true
if the element is initialized per the aforementioned XAMLXAML processing or method calls; otherwise, false
.
注解
如果此元素已在逻辑树中移动,以使其具有新的父元素,并因此再次加载,则此属性也可能 true
。This property may also be true
if this element has been moved within the logical tree such that it has a new parent element, and therefore becomes reloaded again.
如果还在使用 BeginInit 和 EndInit,则此属性很有用。This property is useful if you also are using BeginInit and EndInit. 可以确保初始化由 XAMLXAML 处理器加载的逻辑树中的元素。Elements in the logical tree that is loaded by a XAMLXAML processor are assured to be initialized. 调用 EndInit 时,将初始化不在逻辑树中的元素。Elements not in the logical tree are initialized when EndInit is called. 如果没有任何特定的 BeginInit 和 EndInit处理,则在构造函数返回初始化的结果后,就会发生这种情况。In absence of any specific handling of BeginInit and EndInit, this will happen as soon as the constructor returns the initialized result.