void FinishDragOperation(ListViewItem draggedItem, AdornerLayer adornerLayer) { // Let the ListViewItem know that it is not being dragged anymore. ListViewItemDragState.SetIsBeingDragged(draggedItem, false); this.IsDragInProgress = false; if (this.ItemUnderDragCursor != null) { this.ItemUnderDragCursor = null; } // Remove the drag adorner from the adorner layer. if (adornerLayer != null) { adornerLayer.Remove(this.dragAdorner); this.dragAdorner = null; } if (ListViewDragDropManager <ItemType> .itemInDrag != null) { ListViewDragDropManager <ItemType> .itemInDrag = null; } beginDragLoc = new Point(-10000, -10000); }
void InitializeDragOperation(ListViewItem itemToDrag) { // Set some flags used during the drag operation. this.IsDragInProgress = true; this.canInitiateDrag = false; // Let the ListViewItem know that it is being dragged. ListViewItemDragState.SetIsBeingDragged(itemToDrag, true); }
void InitializeDragOperation(ListViewItem itemToDrag) { // Set some flags used during the drag operation. this.IsDragInProgress = true; this.canInitiateDrag = false; Border border = (Border)VisualTreeHelper.GetChild(listView, 0); ScrollViewer scrollViewer = VisualTreeHelper.GetChild(border, 0) as ScrollViewer; this.ptScrollStart = new Point(0, 0); if (scrollViewer != null) { this.ptScrollStart = new Point(scrollViewer.HorizontalOffset, scrollViewer.VerticalOffset); } // Let the ListViewItem know that it is being dragged. ListViewItemDragState.SetIsBeingDragged(itemToDrag, true); }
void FinishDragOperation(ListViewItem draggedItem, AdornerLayer adornerLayer) { // Let the ListViewItem know that it is not being dragged anymore. ListViewItemDragState.SetIsBeingDragged(draggedItem, false); this.IsDragInProgress = false; if (this.ItemUnderDragCursor != null) { this.ItemUnderDragCursor = null; } // Remove the drag adorner from the adorner layer. if (adornerLayer != null) { adornerLayer.Remove(this.dragAdorner); this.dragAdorner = null; } }
void FinishDragOperation(ListViewItem draggedItem, AdornerLayer adornerLayer, bool isDragFullyFinished) { // Let the ListViewItem know that it is not being dragged anymore. ListViewItemDragState.SetIsBeingDragged(draggedItem, false); this.IsDragInProgress = false; if (this.ItemUnderDragCursor != null) { this.ItemUnderDragCursor = null; } // Remove the drag adorner from the adorner layer. if (adornerLayer != null) { adornerLayer.Remove(this.dragAdorner); this.dragAdorner = null; } if (IsDeleteSourceItem && isDragFullyFinished && this.listView.ItemsSource is ObservableCollection <ItemType> collection) { collection.RemoveAt(this.listView.SelectedIndex); } }