ParentAdapter 类

更新:2007 年 11 月

为可作为子对象的父级的任意类型提供扩展点。

命名空间:  Microsoft.Windows.Design.Interaction
程序集:  Microsoft.Windows.Design.Extensibility(在 Microsoft.Windows.Design.Extensibility.dll 中)

语法

声明
Public MustInherit Class ParentAdapter _
    Inherits Adapter
用法
Dim instance As ParentAdapter
public abstract class ParentAdapter : Adapter
public ref class ParentAdapter abstract : public Adapter
public abstract class ParentAdapter extends Adapter

备注

可从 ParentAdapter 中继承,以便在 WPF 设计器中指定父子关系。

在 Windows Presentation Foundation (WPF) 中在不同子级之间移动元素或向父级添加元素通常需要具备父子关系的专门知识。不为每个容器实现容器特定的逻辑,ParentAdapter 类会定义扩展点,并支持将一个对象的父级更改为其他对象的泛型机制。

ParentAdapter 由 Parent 方法调用。ModelParent 为当前和建议的父对象查找 ParentAdapter。如果不存在 ParentAdapter,则不能为对象分配父级。

ParentAdapter 类使容器可在父级被移除时执行逻辑。例如,如果将某一对象从 Canvas 移至 Grid,则可自动移除画布的附加属性。

继承层次结构

System.Object
  Microsoft.Windows.Design.Features.FeatureProvider
    Microsoft.Windows.Design.Interaction.Adapter
      Microsoft.Windows.Design.Interaction.ParentAdapter

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

另请参见

参考

ParentAdapter 成员

Microsoft.Windows.Design.Interaction 命名空间

ModelParent

ModelItem

其他资源

WPF 设计器扩展性