Freezable.GetCurrentValueAsFrozenCore(Freezable) Freezable.GetCurrentValueAsFrozenCore(Freezable) Freezable.GetCurrentValueAsFrozenCore(Freezable) Freezable.GetCurrentValueAsFrozenCore(Freezable) Method


使当前实例成为指定 Freezable 的冻结克隆。Makes the current instance a frozen clone of the specified Freezable. 如果对象具有动画依赖属性,则复制其当前的动画值。If the object has animated dependency properties, their current animated values are copied.

 virtual void GetCurrentValueAsFrozenCore(System::Windows::Freezable ^ sourceFreezable);
protected virtual void GetCurrentValueAsFrozenCore (System.Windows.Freezable sourceFreezable);
abstract member GetCurrentValueAsFrozenCore : System.Windows.Freezable -> unit
override this.GetCurrentValueAsFrozenCore : System.Windows.Freezable -> unit
Protected Overridable Sub GetCurrentValueAsFrozenCore (sourceFreezable As Freezable)


Freezable Freezable Freezable Freezable

要复制和冻结的 FreezableThe Freezable to copy and freeze.


调用此方法GetCurrentValueAsFrozen方法应不直接从代码中,除非调用在调用时重写此方法的基实现。This method is called by the GetCurrentValueAsFrozen method and should not be called directly from your code, except when calling the base implementation while overriding this method. 若要创建当前对象的冻结的副本,请调用GetCurrentValueAsFrozen而不是直接调用此方法。To create a frozen copy of the current object, call GetCurrentValueAsFrozen instead of calling this method directly.


如果从其中派生Freezable,可能需要重写此方法。If you derive from Freezable, you may need to override this method. 重写的原因包括:Reasons to override include the following: -在派生的类具有未通过依赖关系属性公开的数据。- Your derived class has data that is not exposed via dependency properties.

-在派生的类必须执行额外的初始化工作,不能通过仅重写CreateInstanceCore()- Your derived class must perform extra initialization work that cannot be accomplished by simply overriding CreateInstanceCore(). 例如,这适用于你的派生的类实现ISupportInitializeFor example, this applies if your derived class implements ISupportInitialize.

依赖项属性中存储其所有数据且,不需要执行额外的初始化工作的类无需重写GetCurrentValueAsFrozenCore(Freezable)Classes that store all their data in dependency properties and that do not need to perform extra initialization work do not need to override GetCurrentValueAsFrozenCore(Freezable).

所有实现,都调用此方法的基实现至关重要。It is essential that all implementations call the base implementation of this method. 实现才应执行的默认实现不执行工作。Implementations should only perform work that is not performed by the default implementation. 默认实现将创建一个新Freezable使用CreateInstance()可冻结对象的方法,并使深层副本和卷影副本的所有其他可写本地设置它包含的属性。The default implementation creates a new Freezable using the CreateInstance() method and makes deep copies of unfrozen freezables and shallow copies of all other writable, locally set properties it contains. 如果对象具有数据绑定依赖关系属性,复制的数据绑定,但可能不再解析;有关克隆数据绑定对象的详细信息,请参阅Freezable 对象概述If the object has data-bound dependency properties, the data bindings are copied but might no longer resolve; for more information about cloning data-bound objects, see Freezable Objects Overview. 如果该对象具有经过动画处理的依赖项属性,复制这些属性经过动画处理的当前值,但动画不是。If the object has animated dependency properties, the current animated value of those properties is copied, but the animations are not.

中的只读依赖属性Freezable不复制此默认实现。Read-only dependency properties within a Freezable are not copied by this default implementation.

如果你重写此方法,则必须调用基实现。If you do override this method, you must call the base implementation.

不需要Freeze()值的复制。You do not need to Freeze() values as they are copied. 结果被冻结GetAsFrozen()之前返回。The result is frozen by GetAsFrozen() before being returned.