This documentation is archived and is not being maintained.

Freezable.Freeze Method (Freezable, Boolean)

If the isChecking parameter is set to true, this method determines whether the specified Freezable can be made unmodifiable. Otherwise, if the isChecking parameter is set to false, this method makes a Freezable unmodifiable and sets its IsFrozen property to true.

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

protected internal static bool Freeze (
	Freezable freezable,
	bool isChecking
)
protected static boolean Freeze (
	Freezable freezable, 
	boolean isChecking
)
protected internal static function Freeze (
	freezable : Freezable, 
	isChecking : boolean
) : boolean
You cannot use methods in XAML.

Parameters

freezable

The object to check or make unmodifiable. If the isChecking parameter is set to true, this object is checked to determine whether it can be made unmodifiable. If isChecking is false, this object is made unmodifiable, if possible.

isChecking

Set to true to have this method check whether the specified Freezable can be made unmodifiable. Set to false to have this method attempt to make the specified Freezable unmodifiable.

Return Value

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 if the specified Freezable is now unmodifiable, or false if it cannot be made unmodifiable, with the side effect of having made the actual change in frozen status to this object.

Exception typeCondition

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 legal to call this method again on a Freezable object that is already frozen (unmodifiable).

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: