ObservableCollection<T>.MoveItem(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定索引上的項目移動到集合中的新位置。
protected:
virtual void MoveItem(int oldIndex, int newIndex);
protected virtual void MoveItem(int oldIndex, int newIndex);
abstract member MoveItem : int * int -> unit
override this.MoveItem : int * int -> unit
Protected Overridable Sub MoveItem (oldIndex As Integer, newIndex As Integer)
參數
- oldIndex
- Int32
以零為基礎的索引,指定要移動的物品位置。
- newIndex
- Int32
以零為基礎的索引,指定項目的新位置。
備註
這種實作提升了事件的水準 CollectionChanged 。
子類別可以覆寫此受保護的方法,為該 Move 方法提供自訂行為。