Delen via


UIElementCollection.Move(UInt32, UInt32) Method

Definition

Moves the item at the specified index to a new location in the collection.

public:
 virtual void Move(unsigned int oldIndex, unsigned int newIndex) = Move;
void Move(uint32_t const& oldIndex, uint32_t const& newIndex);
public void Move(uint oldIndex, uint newIndex);
function move(oldIndex, newIndex)
Public Sub Move (oldIndex As UInteger, newIndex As UInteger)

Parameters

oldIndex
UInt32

unsigned int

uint32_t

The zero-based index specifying the location of the item to be moved.

newIndex
UInt32

unsigned int

uint32_t

The zero-based index specifying the new location of the item.

Remarks

Calling this method offers advantages over removing an item and adding it to a new location. Specifically, not as much tree rebuilding is required internally, and panels or controls that use UIElementCollection for items can be more responsive.

An example of a scenario where using Move may be useful is if you have a collection view or a specialized panel that supports a user experience where items wrap around. In this case you might want to move an item from the start of the collection to the end or vice versa, without forcing the entire visual tree under the panel or view to be rebuilt.

Applies to