Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft