Many types in WPF derive from Freezable. It provides immutability to mutable POCO objects and allows for improved performance in certain situations.
So my question is, how can I freeze objects in XAML markup?
(Note that I have posted a similar but different question too).
To freeze a
Freezableobject declared in markup, you use theFreezeattribute defined in XML namespacehttp://schemas.microsoft.com/winfx/2006/xaml/presentation/options.In the following example, a
SolidColorBrushis declared as a page resource and frozen. It is then used to set the background of a button.Source: Freezable Objects Overview