會將物件的父代變更為另一個父代。
命名空間: Microsoft.Windows.Design.Interaction
組件: Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)
語法
'宣告
Public Overridable Sub Parent ( _
newParent As ModelItem, _
child As ModelItem, _
insertionIndex As Integer _
)
public virtual void Parent(
ModelItem newParent,
ModelItem child,
int insertionIndex
)
public:
virtual void Parent(
ModelItem^ newParent,
ModelItem^ child,
int insertionIndex
)
abstract Parent :
newParent:ModelItem *
child:ModelItem *
insertionIndex:int -> unit
override Parent :
newParent:ModelItem *
child:ModelItem *
insertionIndex:int -> unit
public function Parent(
newParent : ModelItem,
child : ModelItem,
insertionIndex : int
)
參數
- newParent
型別:Microsoft.Windows.Design.Model.ModelItem
子系的新父項目。
- child
型別:Microsoft.Windows.Design.Model.ModelItem
子項目。
- insertionIndex
型別:System.Int32
子集合中控制項的順序。
例外狀況
| 例外狀況 | 條件 |
|---|---|
| ArgumentNullException | newParent 或 child 是 nullNull 參照 (即 Visual Basic 中的 Nothing)。 |
備註
使用 Parent 方法來設定父子式關聯。
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.Windows.Design.Interaction 命名空間