private void OnDragItemCompleted(DragDropCompletedData completedData) { if (completedData.DropResult != DataPackageOperation.None) { var draggedItems = completedData.Items.Cast <CustomItem>(); foreach (var item in draggedItems) { Items.Remove(item); } listview.AllowDrop = !Items.Any(); } }
private static void ConfigureListView(ListViewBase listview, ListViewDropConfiguration configuration) { listview.DragItemsStarting += (sender, args) => { var data = new DragDropStartingData { Data = args.Data, Items = args.Items }; configuration.DragItemsStartingCommand?.Execute(data); }; listview.DragItemsCompleted += (sender, args) => { var data = new DragDropCompletedData { DropResult = args.DropResult, Items = args.Items }; configuration.DragItemsCompletedCommand?.Execute(data); }; }
private static void ConfigureListView(ListViewBase listview, ListViewDropConfiguration configuration) { //{[{ listview.DragItemsStarting += (sender, args) => { var data = new DragDropStartingData { Data = args.Data, Items = args.Items }; configuration.DragItemsStartingAction?.Invoke(data); }; listview.DragItemsCompleted += (sender, args) => { var data = new DragDropCompletedData { DropResult = args.DropResult, Items = args.Items }; configuration.DragItemsCompletedAction?.Invoke(data); }; //}]} }