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