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
)
You cannot use methods in XAML.

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.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft