FrameworkElement.IsInitialized FrameworkElement.IsInitialized FrameworkElement.IsInitialized FrameworkElement.IsInitialized Property


取得值,指出在由 XAMLXAML 處理器處理期間,或是明確地呼叫 EndInit() 方法時,是否已初始化這個項目。Gets a value that indicates whether this element has been initialized, either during processing by a XAMLXAML processor, or by explicitly having its EndInit() method called.

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


如果對於每個先前提及的 XAMLXAML 處理或方法呼叫將項目初始化,則為 true;否則為 falsetrue 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. 如果沒有BeginInitEndInit的任何特定處理, 就會在此函式傳回初始化的結果時立即發生。In absence of any specific handling of BeginInit and EndInit, this will happen as soon as the constructor returns the initialized result.