IAddChild Interface

Definition

提供分析允许混合子元素或文本的元素所需的方法。Provides a means to parse elements that permit mixtures of child elements or text.

public interface class IAddChild
public interface IAddChild
type IAddChild = interface
Public Interface IAddChild
Derived

Remarks

为了在 WPF 中建立或定义内容属性或内容模型,IAddChild 已过时。For purposes of establishing or defining a content property or content model in WPF, IAddChild is obsolete. 改为将 ContentPropertyAttribute 应用到自定义类。Apply the ContentPropertyAttribute to a custom class instead.

出于 XAML 分析器/处理器行为的目的,IAddChild 已过时。For purposes of XAML parser/processor behavior, IAddChild is obsolete. 集合行为现在 integrally XAML 类型系统的一部分,XAML 处理器实现应使用 system.exception 程序集中的专用 Api。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. 一般用户代码应对用于相关类型的子集合属性的集合类型使用 Add 方法。General user code should use the Add methods on the collection type used for the relevant type's child collection property.

IAddChild 的主要剩余方案是支持可以处理子对象创建的 FrameworkElementFactory,这是一种高级方案。The main remaining scenario for IAddChild is to support a FrameworkElementFactory that can handle child object creation, which is an advanced scenario. 请参阅 FrameworkElementFactorySee FrameworkElementFactory.

.NET Framework 4.5 Beta 目标应用程序中的调用方尝试将 IAddChild API 用于其原始 .NET Framework 3.0.NET Framework 3.0 时代之一(WPF 内容模型、XAML 处理),则应预计许多当前 IAddChild实现类将返回 NotImplementedException API IAddChild 或类似的结果。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.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.

Methods

AddChild(Object)

添加子对象。Adds a child object.

AddText(String)

将节点的文本内容添加到对象。Adds the text content of a node to the object.

Applies to

See also