ObservableCollection<T>.MoveItem(Int32, Int32) 方法

定義

將所指定索引位置的項目移至集合中的新位置。

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 自訂行為。

適用於