private void OnDrop(object sender, DragEventArgs e) { DropFileObject.SetIsDragging((DependencyObject)sender, false); var hasData = e.Data.GetDataPresent("FileDrop"); if (!hasData) { return; } var data = e.Data.GetData("FileDrop") as string[]; if (data == null || !data.Any()) { return; } var files = ((PackageSigningViewModel)this.DataContext).Files; foreach (var item in data) { if (files.Contains(item)) { continue; } files.Add(item); } }
private void OnDragEnter(object sender, DragEventArgs e) { DropFileObject.SetIsDragging((DependencyObject)sender, false); var hasData = e.Data.GetDataPresent("FileDrop"); if (!hasData) { return; } var data = e.Data.GetData("FileDrop") as string[]; if (data == null || !data.Any()) { return; } DropFileObject.SetIsDragging((DependencyObject)sender, true); }
private void OnFileDropped(object sender, DragEventArgs e) { DropFileObject.SetIsDragging((DependencyObject)sender, false); var hasData = e.Data.GetDataPresent("FileDrop"); if (!hasData) { return; } var data = e.Data.GetData("FileDrop") as string[]; if (data == null || !data.Any()) { return; } var dropped = new FileInfo(data.First()); this.dialogOpener.OpenFile(dropped); }
private void OnDragLeave(object sender, DragEventArgs e) { DropFileObject.SetIsDragging((DependencyObject)sender, false); }
private void OnDragEnter(object sender, DragEventArgs e) { DropFileObject.SetIsDragging((DependencyObject)sender, true); }