Moves an item in a list to a new index.
| C# | Visual Basic | Visual C++ |
public static void MoteToIndex( IList<ContentItem> siblings, ContentItem itemToMove, int newIndex )
Public Shared Sub MoteToIndex ( _ siblings As IList(Of ContentItem), _ itemToMove As ContentItem, _ newIndex As Integer _ )
public: static void MoteToIndex ( IList<ContentItem^>^ siblings, ContentItem^ itemToMove, int newIndex )
- siblings (IList<(Of <ContentItem>)>)
- A list of items where the item to move is listed.
- itemToMove (ContentItem)
- The item that should be moved (must be in the list)
- newIndex (Int32)
- The new index onto which to place the item.
To persist the new ordering one should call UpdateSortOrder(IEnumerable<(Of <ContentItem>)>) and save the returned items. If the items returned from the GetChildren()() are moved with this method the changes will not be persisted since this is a new list instance.