Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Freeze() |
Makes the current object unmodifiable and sets its IsFrozen property to |
Freeze(Freezable, Boolean) |
If the |
Makes the current object unmodifiable and sets its IsFrozen property to true
.
public:
void Freeze();
public void Freeze();
member this.Freeze : unit -> unit
Public Sub Freeze ()
The Freezable cannot be made unmodifiable.
To avoid the possibility of an InvalidOperationException when calling this method, check the CanFreeze property to determine whether the Freezable can be made unmodifiable before calling this method.
This method uses the FreezeCore(Boolean) method to make the Freezable unmodifiable. To modify freezing behavior, override the FreezeCore(Boolean) method.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
protected public:
static bool Freeze(System::Windows::Freezable ^ freezable, bool isChecking);
protected internal static bool Freeze(System.Windows.Freezable freezable, bool isChecking);
static member Freeze : System.Windows.Freezable * bool -> bool
Protected Friend Shared Function Freeze (freezable As Freezable, isChecking As Boolean) As Boolean
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.
true
to return an indication of whether the object can be frozen (without actually freezing it); false
to actually freeze the object.
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.
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).
This method uses the FreezeCore(Boolean) method to make the Freezable unmodifiable. To modify freezing behavior, override the FreezeCore(Boolean) method.
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in