VisualCollection.RemoveAt(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
移除指定索引 VisualCollection處的視覺物件。
public:
void RemoveAt(int index);
public void RemoveAt(int index);
member this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)
參數
- index
- Int32
視覺的零基索引要移除。
例外狀況
index 小於零,或 index 等於或大於 Count。
備註
跟隨被移除物件的視覺物件會被移位至空出的位置,並更新其索引值。
此 RemoveAt 方法同時移除父視覺化(即 的 VisualCollection擁有者)與子 visual節點之間的父子關係。
如果你需要對視覺子物件底層儲存實作有更深的低階控制,可以考慮使用 AddVisualChild and RemoveVisualChild 方法。 使用這些方法時,你會定義自己的儲存實作,而非使用 VisualCollection。