Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.68 KB

how-to-obtain-a-writable-copy-of-a-read-only-freezable.md

File metadata and controls

33 lines (25 loc) · 1.68 KB
title ms.date dev_langs helpviewer_keywords ms.assetid description
How to: Obtain a Writable Copy of a Read-Only Freezable
03/30/2017
csharp
vb
cloning Freezable objects [WPF]
Freezable objects [WPF], modifiable clones
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.

How to: Obtain a Writable Copy of a Read-Only Freezable

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.

Example

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.

See also