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