Freezable.WritePreamble Freezable.WritePreamble Freezable.WritePreamble Freezable.WritePreamble Method

定義

確認 Freezable 未凍結,而且是從有效的執行緒內容進行存取。Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. 在任何 APIAPI 將資料寫入至非相依性屬性的資料成員之前,Freezable 繼承者應該在 API 的開頭呼叫這個方法。Freezable inheritors should call this method at the beginning of any APIAPI that writes to data members that are not dependency properties.

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

例外狀況

Freezable 執行個體已凍結,無法寫入它的成員。The Freezable instance is frozen and cannot have its members written to.

備註

這個方法會VerifyAccess呼叫以確認執行緒內容可供存取, Freezable如果實例已經凍結, 它就會擲回例外狀況。This method calls VerifyAccess to verify the threading context is accessible, and it throws an exception if the Freezable instance is already frozen.

給繼承者的注意事項

衍生自Freezable的類別應該在WritePreamble()嘗試寫入任何不是相依性屬性的成員之前呼叫。Classes that derive from Freezable should call WritePreamble() before attempting to write to any members that are not dependency properties. 如果您WritePreamble() ReadPreamble()在中呼叫, 則可以省略對的呼叫。 APIAPIIf you call WritePreamble() in an APIAPI, you can omit a call to ReadPreamble().

適用於

另請參閱