Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-determine-whether-a-freezable-is-frozen.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.6 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Determine Whether a Freezable Is Frozen 03/30/2017
csharp
vb
Freezable objects [WPF], determining if frozen
92e58baa-ee12-4a9e-ac3a-ca458807a8b2

How to: Determine Whether a Freezable Is Frozen

This example shows how to determine whether a xref:System.Windows.Freezable object is frozen. If you try to modify a frozen xref:System.Windows.Freezable object, it throws an xref:System.InvalidOperationException. To avoid throwing this exception, use the xref:System.Windows.Freezable.IsFrozen%2A property of the xref:System.Windows.Freezable object to determine whether it is frozen.

Example

The following example freezes a xref:System.Windows.Media.SolidColorBrush and then tests it by using the xref:System.Windows.Freezable.IsFrozen%2A property to determine whether it is frozen.

[!code-csharpfreezablesample_procedural#CheckIsFrozenExample] [!code-vbfreezablesample_procedural#CheckIsFrozenExample]

For more information about xref:System.Windows.Freezable objects, see the Freezable Objects Overview.

See also