Makes the current object unmodifiable and sets its IsFrozen property to true.
Assembly: WindowsBase (in WindowsBase.dll)
You cannot freeze a Freezable object if any one of the following conditions is true about the object:
It has animated or data bound properties.
It has properties that are set by a dynamic resource. For more information about dynamic resources, see the Resources Overview.
It contains Freezable sub-objects that cannot be frozen.
If these conditions are false for your Freezable object and you do not intend to modify it, consider freezing it to gain performance benefits.
|How to: Determine Whether a Freezable Is Frozen||This example shows how to determine whether a Freezable object is frozen. If you try to modify a frozen Freezable object, it throws an InvalidOperationException. To avoid throwing this exception, use the IsFrozen property of the Freezable object to determine whether it is frozen.|
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003