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 設計工具中指定父-子關係 (Parent-Child Relationship)。
在 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
執行緒安全
這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。
請參閱
參考
Microsoft.Windows.Design.Interaction 命名空間