I have a listview that displays files from a directory. The user can drag each item in the listview to a folder/ the desktop and the associated file is copied there.
private List _selItems = new List(); private void FileView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this._start = e.GetPosition(null); _selItems.Clear(); _selItems.AddRange(FileView.SelectedItems.Cast()); }
restore on MouseMove
foreach (object selItem in _selItems) { if (!FileView.SelectedItems.Contains(selItem)) FileView.SelectedItems.Add(selItem); }