Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
This class is provided to enable the creation of custom collection types that fully support data binding, change notification, property invalidation, and animation of its contents.
XAML Usage for FreezableCollection
supports a limited XAML syntax.
As an object element at the root, you can theoretically specify an unconstrained object element, which must also specify the x:TypeArguments Attribute to declare the constraint. However, this is not a common scenario, because to do this, the must be the root element. This limitation exists because the XAML processor implementation in WPF can only support x:TypeArguments Attribute when the element it is being set on is the root element, and you must use x:TypeArguments on any open constraint generic if you want to instantiate a generic type in XAML. It is unlikely that you want a as the root element, even as loose XAML.
If you derive from and apply a type constraint in the derived collection, the derived collection can support a variety of usages. This is possible because the constraint in your derivation eliminates the need to pass x:TypeArguments.
The typical XAML usage for such a derived collection is through implicit collection syntax. Collections that support certain interfaces do not need to specify the collection itself as an object element. For details on collection syntax in XAML, see XAML Syntax Terminology. For instance, an object with a property where the property was of type constrained by DependencyObject could support the following syntax:
<object> <object.property> oneOrMoreDependencyObjectElements </object.property> </object>
As long as you do not hide the default constructor, the derived collection can also support an object element syntax (where the object element is explicit, as opposed to the implicit usage shown above). It does not need to be the root element. Or, you can also use the derived collection as a root element, without needing to specify x:TypeArguments, although using a collection as a root element is uncommon.
Any child elements of the collection in either of the above scenarios must be of the type of either the implemented constraint, or as specified by x:TypeArguments.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.