Beispiel #1
0
        /// <summary>
        /// Method called when dropping an item.
        /// </summary>
        /// <param name="dropInfo"></param>
        async void IDropTarget.Drop(IDropInfo dropInfo)
        {
            // Get source and target
            TodoViewModel sourceItem = dropInfo.Data as TodoViewModel;
            TodoViewModel targetItem = dropInfo.TargetItem as TodoViewModel;

            // Let the Todo-items switch places
            Todos.Move(Todos.IndexOf(sourceItem), Todos.IndexOf(targetItem));

            // Update todo order
            await UpdateTodoOrder();

            DragHandleActive = false;
        }