IAddChild Interface


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Provides a means to parse elements that permit mixtures of child elements or text.

Namespace:   System.Windows.Markup
Assembly:  PresentationCore (in PresentationCore.dll)

public interface IAddChild


Adds a child object.


Adds the text content of a node to the object.

For purposes of establishing or defining a content property or content model in WPF, IAddChild is obsolete. Apply the ContentPropertyAttribute to a custom class instead.

For purposes of XAML parser/processor behavior, IAddChild is obsolete. Collection behavior is now integrally part of the XAML type system and XAML processor implementations should use the dedicated APIs in the System.Xaml assembly. General user code should use the Add methods on the collection type used for the relevant type's child collection property.

The main remaining scenario for IAddChild is to support a FrameworkElementFactory that can handle child object creation, which is an advanced scenario. See FrameworkElementFactory.

Callers in .NET Framework 4.5 Beta targeted applications that attempt to use the IAddChild API for one of its original .NET Framework 3.0 era purposes (WPF content model, XAML processing) should expect that many current IAddChild-implementing classes will return NotImplementedException or similar results for the IAddChild API.

.NET Framework
Available since 3.0
Return to top