Freezable.Freeze Method (Freezable, Boolean)
Namespace: System.Windows
Assembly: WindowsBase (in WindowsBase.dll)
Parameters
- freezable
- Type: System.Windows.Freezable
The object to check or make unmodifiable. If isChecking is true, the object is checked to determine whether it can be made unmodifiable. If isChecking is false, the object is made unmodifiable, if possible.
- isChecking
- Type: System.Boolean
true to return an indication of whether the object can be frozen (without actually freezing it); false to actually freeze the object.
Return Value
Type: System.BooleanIf isChecking is true, this method returns true if the specified Freezable can be made unmodifiable, or false if it cannot be made unmodifiable. If isChecking is false, this method returns true if the specified Freezable is now unmodifiable, or false if it cannot be made unmodifiable.
| Exception | Condition |
|---|---|
| InvalidOperationException | When isChecking is false, the attempt to make freezable unmodifiable was unsuccessful; the object is now in an unknown state (it might be partially frozen). |
Do not call this method unless you are deriving from Freezable and overriding the FreezeCore method. This method may be used in the FreezeCore method to freeze class data members that are themselves Freezable objects.
It is alright to call this method again on a Freezable object that is already frozen (unmodifiable).
Notes to InheritorsThis method uses the FreezeCore method to make the Freezable unmodifiable. To modify freezing behavior, override the FreezeCore method.
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.