private void FileDrop(object sender, DragEventArgs e) { Debug.WriteLine("MainWindow.FileDrop(), something dropped."); if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); if (files.Length > 0) { foreach (string fileName in files) { if (bindedViewModel.FileAllowed(fileName)) { bindedViewModel.SetNewFile(new Uri(fileName)); break; } } } } DropOverlay.SetBinding(Grid.VisibilityProperty, overlayVisibilityBindingExpress.ParentBinding); }
private void FileDragLeave(object sender, DragEventArgs e) { DropOverlay.SetBinding(Grid.VisibilityProperty, overlayVisibilityBindingExpress.ParentBinding); }