Freezable.ReadPreamble 方法

定義

確定 Freezable 是從有效的執行緒進行存取。Ensures that the Freezable is being accessed from a valid thread. 如果 API 會讀取非相依性屬性的資料成員,則 Freezable 的繼承者必須在該 API 的開頭呼叫這個方法。Inheritors of Freezable must call this method at the beginning of any API that reads data members that are not dependency properties.

protected:
 void ReadPreamble();
protected void ReadPreamble ();
member this.ReadPreamble : unit -> unit
Protected Sub ReadPreamble ()

給繼承者的注意事項

衍生自 Freezable 的類別應該先呼叫 ReadPreamble() 方法,再嘗試存取任何不是相依性屬性的成員。Classes that derive from Freezable should call the ReadPreamble() method before they attempt to access any members that are not dependency properties. 在將任何這類成員寫入之前,應該先呼叫 WritePreamble() 方法。The WritePreamble() method should be called before any such members are written to.

這個方法實際上不會執行任何 VerifyAccess()的呼叫。This method effectively does nothing more than call VerifyAccess().

適用於

另請參閱