Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.

Freezable.Freeze-Methode (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
Sie können diese Methoden nicht in XAML verwenden.

Parameter

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.

Rückgabewert

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.

AusnahmetypBedingung

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).

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

Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.

.NET Framework

Unterstützt in: 3.0
Anzeigen: