The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
How to: Make a Freezable Read-Only
This example shows how to make a
read-only by calling its Freezable method. Freeze
You cannot freeze a
object if any one of the following conditions is Freezable about the object: true
It has animated or data bound properties.
It has properties that are set by a dynamic resource. For more information about dynamic resources, see the
. Resources Overview
sub-objects that cannot be frozen. Freezable
If these conditions are
for your false object and you do not intend to modify it, consider freezing it to gain performance benefits. Freezable
The following example freezes a
, which is a type of SolidColorBrush object. Freezable
Button myButton = new Button();
SolidColorBrush myBrush = new SolidColorBrush(Colors.Yellow);
// Makes the brush unmodifiable.
myButton.Background = myBrush;
For more information about
objects, see the Freezable . Freezable Objects Overview Concepts Reference Other Resources