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().

适用于

另请参阅