Freezable.Freeze Method (Freezable, Boolean)

If the isChecking parameter is true, this method indicates whether the specified Freezable can be made unmodifiable. If the isChecking parameter is false, this method attempts to make the specified Freezable unmodifiable and indicates whether the operation succeeded.

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

protected internal static bool Freeze(
	Freezable freezable,
	bool isChecking
)

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.Boolean
If 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.

ExceptionCondition
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 Inheritors

This method uses the FreezeCore method to make the Freezable unmodifiable. To modify freezing behavior, override the FreezeCore method.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft