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. Freezable 的继承项应当在任何 APIAPI 一开始写入不属于依赖项属性的数据成员时调用此方法。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()APIAPI,则可以省略调用ReadPreamble()If you call WritePreamble() in an APIAPI, you can omit a call to ReadPreamble().

适用于

另请参阅