My page contains two ListView elements, ListA and ListB. You can copy items (objects) from ListA to ListB by use of simple drag and drop. For that I use the Lists' DragItemsStarting and Drop events. That works just fine. Now you can reorder the items in ListB. All required properties are set (reorder, drag and drop) and this works as well.
But now I want to react on the resorting, but I didn't find an event I could listen to. So I thought it might be possible to use the drag/drop events on the same list to get to know when the user has changed the psoition of an item.
So how can I recognize that the items of ListB have been reorderd?
My code (with the drag and drop approach):
private void ListB_DragItemsStarting(object sender, DragItemsStartingEventArgs e) {
var item = ((FeedItem)e.Items[0]);
e.Data.RequestedOperation = DataPackageOperation.Move;
e.Data.SetDataProvider("FeedItem", request => request.SetData(item));
}
private async void ListB_Drop(object sender, DragEventArgs e) {
DataPackageView view = e.Data.GetView();
if (view.Contains("FeedItem") && view.RequestedOperation == DataPackageOperation.Copy) {
//item from ListA
}
if (view.Contains("FeedItem") && view.RequestedOperation == DataPackageOperation.Move) {
//item from ListB
}
}