Gets a value that indicates whether the object is currently modifiable.
Assembly: WindowsBase (in WindowsBase.dll)
Attempting to modify an object when its 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 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 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.
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 property of the Freezable object to determine whether it is frozen.
The following example freezes a SolidColorBrush and then tests it by using the property to determine whether it is frozen.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.