Freezable.CloneCurrentValue Freezable.CloneCurrentValue Freezable.CloneCurrentValue Freezable.CloneCurrentValue Method

定义

使用 Freezable 的当前值创建其可修改复本(深层副本)。Creates a modifiable clone (deep copy) of the Freezable using its current values.

public:
 System::Windows::Freezable ^ CloneCurrentValue();
public System.Windows.Freezable CloneCurrentValue ();
member this.CloneCurrentValue : unit -> System.Windows.Freezable
Public Function CloneCurrentValue () As Freezable

返回

当前对象的可修改复本。A modifiable clone of the current object. 即使源的 IsFrozen 属性为 true.,所克隆对象的 IsFrozen 属性也为 falseThe cloned object's IsFrozen property is false even if the source's IsFrozen property is true.

注解

Clone Freezable方法将生成冻结对象的可修改克隆 (这些方法还Freezable克隆未冻结的对象)。 CloneCurrentValueThe Clone and CloneCurrentValue methods produce modifiable clones of frozen Freezable objects (the methods also clone Freezable objects that are not frozen). 克隆实际上是当前对象的深层副本。The clone is effectively a deep copy of the current object.

下表总结了CloneCloneCurrentValue方法之间的差异。The following table summarizes the differences between the Clone and CloneCurrentValue methods.

操作Action 克隆方法行为Clone method behavior CloneCurrentValue 方法行为CloneCurrentValue method behavior
复制具有表达式的依赖项属性Copying a dependency property that has an expression 表达式已复制, 但可能不再解析。The expression is copied, but might no longer resolve. 有关详细信息,请参阅 Freezable 对象概述For more information, see Freezable Objects Overview. 复制表达式的当前值, 而不是表达式本身。The current value of the expression is copied, but not the expression itself.
复制动画依赖属性Copying an animated dependency property 复制属性的基 (未经过动画处理的) 值。The property's base (non-animated) value is copied. 不复制动画。Animations are not copied. 复制属性的当前动画值。The property's current animated value is copied. 不复制动画。Animations are not copied.

请注意, 不会复制未设置的属性。Note that unset properties are not copied. 如果未设置属性的默认值为冻结Freezable, 则该属性的值在其他可修改复本中保持冻结状态。If an unset property has a default value that is a frozen Freezable, that property value remains frozen in the otherwise modifiable clone.

在线程之间移动一个冻结Move a Freezable Between Threads

此方法可用于在线程Freezable之间移动。This method can be useful for moving a Freezable between threads. 首先, 使用其Freezable Freeze方法使不可修改。First, make the Freezable unmodifiable by using its Freeze method. 现在Freezable , 另一个线程可以访问并创建它可以访问的本地克隆。Now another thread can access the Freezable and make a local clone that it can access.

继承者说明

此方法使用CloneCurrentValueCore(Freezable)方法生成克隆;Freezable重写CloneCurrentValueCore(Freezable)的实施者必须确保在创建时未冻结副本。This method uses the CloneCurrentValueCore(Freezable) method to produce the clone; Freezable implementers who override CloneCurrentValueCore(Freezable) must ensure that the copy is not frozen on creation.

适用于

另请参阅