IsFrozen Property
Collapse the table of content
Expand the table of content

Freezable.IsFrozen Property


Gets a value that indicates whether the object is currently modifiable.

Namespace:   System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)

public bool IsFrozen { get; }

Property Value

Type: System.Boolean

true if the object is frozen and cannot be modified; false if the object can be modified.

Attempting to modify an object when its IsFrozen property is true throws an InvalidOperationException.

This property is read-only from the object model perspective. Some of the documentation about Freezable behaviors may mention "sets IsFrozen to true" or similar language when discussing the behavior of other methods of Freezable, but this behavior is happening internally in the class instances, when methods of the instance manipulate the private variables that exist within the abstract class. To set the value of this property, you should call Freeze. This effectively is a one-time operation to change the IsFrozen property from the initial default false state to the true state. There is no available means to set the value back to false. Instead, you could change any deep copy made from the original (see the Clone method). This is by design and is how any derived class should behave when applied to the cases where the Freezable pattern is useful.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft