Freezable::Freeze Method

Makes the current object unmodifiable and sets its IsFrozen property to true.

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

public:
void Freeze()

ExceptionCondition
InvalidOperationException

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.

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.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft