Freezable::GetCurrentValueAsFrozen Method
Creates a frozen copy of the Freezable using current property values. Because the copy is frozen, any frozen sub-objects are copied by reference.
Assembly: WindowsBase (in WindowsBase.dll)
Using this method is similar to creating a copy using the CloneCurrentValue and then freezing it with the Freeze method.
The GetAsFrozen and GetCurrentValueAsFrozen methods can improve copying performance because they do not clone Freezable sub-objects that are already frozen; they only copy them by reference.
The following table summarizes the differences between the GetAsFrozen and GetCurrentValueAsFrozen methods.
Action | GetAsFrozen method behavior | GetCurrentValueAsFrozen method behavior |
|---|---|---|
Copying a dependency property that has an expression | The method throws an InvalidOperationException because it cannot Freeze the property. | 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, nor are read-only properties.
To create a copy of the Freezable that is not frozen, use the CloneCurrentValue method.
Notes to InheritorsThis method uses the virtual GetCurrentValueAsFrozenCore method to produce the clone.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.