Επεξεργασία

Κοινή χρήση μέσω


Freezable.GetAsFrozenCore(Freezable) Method

Definition

Makes the instance a frozen clone of the specified Freezable using base (non-animated) property values.

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

Parameters

sourceFreezable
Freezable

The instance to copy.

Remarks

This method is called by the GetAsFrozen method and should not be called directly from your code, except when calling the base implementation while overriding this method. To create a frozen copy of the current object, call GetAsFrozen instead of calling this method directly.

Notes to Inheritors

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.

  • Your derived class must perform extra initialization work that cannot be accomplished by simply overriding CreateInstanceCore(). For example, this applies if your derived class implements ISupportInitialize.

Classes that store all their data in dependency properties and that do not need to perform extra initialization work do not need to override GetAsFrozenCore(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. The default implementation makes deep copies of any unfrozen freezables and shallow copies of all other writable, locally set properties it contains. If the object has data-bound dependency properties, the expressions 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 base (non-animated) values of those properties are copied. Animations are not copied.

Note that unset properties are not copied, nor are read-only properties.

If you do override this method, you must call the base implementation.

You do not need to Freeze() values as they are copied. The result is frozen by GetAsFrozen() before being returned.

Applies to

See also