public void DoDrop(string[] fileNames) { List <string> imageFiles = PhotoUploadWizard.FindImageFiles(fileNames); if (imageFiles.Count != 0) { if (ServiceProvider.ViewManager.EndDialog(ServiceProvider.ViewManager.Dialog)) { // This is a bit hacky. Don't clear the selected album on drop // if a dialog (e.g. an existing upload wizard) is up. // This will leave it if the embedded browser or settings dialog is up, // but whatever. _photoUploadWizard.SetDefaultAlbum(null); } _photoUploadWizard.Show(imageFiles); } }
protected override void OnDrop(DragEventArgs e) { base.OnDrop(e); if (!DragContainer.IsInDrag) { string[] fileNames = e.Data.GetData(DataFormats.FileDrop) as string[]; List <string> imageFiles = PhotoUploadWizard.FindImageFiles(fileNames); if (imageFiles.Count != 0) { PhotoUploadWizard.Show(imageFiles); } #if !USE_STANDARD_DRAGDROP DropTargetHelper.Drop(e.Data, e.GetPosition(this), DragDropEffects.Copy); #endif } }
private void BrowseButtonClick(object sender, RoutedEventArgs e) { var ofd = new System.Windows.Forms.OpenFileDialog { Filter = "Image Files (*.jpg;*.jpeg;*.gif;*.png)|*.jpg;*.jpeg;*.gif;*.png", Title = "Choose images to upload", InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), Multiselect = true, }; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Hide(); List <string> imageFiles = PhotoUploadWizard.FindImageFiles(ofd.FileNames); if (imageFiles.Count != 0) { Wizard.Show(imageFiles); } } }