title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | description | ||||
---|---|---|---|---|---|---|---|---|---|
How to: Obtain a Writable Copy of a Read-Only Freezable |
03/30/2017 |
|
|
d028de61-bbe9-4d62-b656-8fe3b1b2ca24 |
Learn how to use the Clone method to create a writable copy of a read-only Freezable and create a modifiable clone of the frozen object. |
This example shows how to use the xref:System.Windows.Freezable.Clone%2A method to create a writable copy of a read-only xref:System.Windows.Freezable.
After a xref:System.Windows.Freezable object is marked as read-only ("frozen"), you cannot modify it. However, you can use the xref:System.Windows.Freezable.Clone%2A method to create a modifiable clone of the frozen object.
The following example creates a modifiable clone of a frozen xref:System.Windows.Media.SolidColorBrush object.
[!code-csharpfreezablesample_procedural#CloneExample] [!code-vbfreezablesample_procedural#CloneExample]
For more information about xref:System.Windows.Freezable objects, see the Freezable Objects Overview.
- xref:System.Windows.Freezable
- xref:System.Windows.Freezable.CloneCurrentValue%2A
- Freezable Objects Overview
- How-to Topics