private void FolderPicker_DialogClosed(object sender, RoutedEventArgs e) { if (sender is FilePicker folderPicker) { FilePickerClosedEventArgs args = e as FilePickerClosedEventArgs; if (args.Path != null) { SettingsViewModel vm = DataContext as SettingsViewModel; switch (folderPicker.Tag) { case "osu": vm.OsuDirectory = args.Path; break; case "backup": vm.BackupDirectory = args.Path; break; case "template": vm.TemplateDirectory = args.Path; break; } } } }
private void FilePicker_DialogClosed(object sender, FilePickerClosedEventArgs e) { if (e.DialogResult == MessageBoxResult.OK) { (DataContext as ExportCookingDataViewModel).ExportPath = e.FilePath; txt_path.GetBindingExpression(TextBox.TextProperty).UpdateTarget(); } }
private void FolderPicker_DialogClosed(object sender, RoutedEventArgs e) { FilePickerClosedEventArgs args = e as FilePickerClosedEventArgs; if (args.Path != null) { (DataContext as SkinSelectViewModel).SkinManager.ExportSkin(exportName, args.Path); exportName = null; } }
private void FilePicker_DialogClosed(object sender, RoutedEventArgs e) { if (sender is FilePicker fp) { FilePickerClosedEventArgs args = e as FilePickerClosedEventArgs; if (args.Path != null) { (DataContext as SBCreatorViewModel).SourceImagePath = args.Path; } } }
private void FilePicker_DialogClosed(object sender, FilePickerClosedEventArgs e) { if (e.DialogResult == MessageBoxResult.OK) { MessageBox.Show( string.Format("In-window file picker result was \"OK\"!" + "\nSelected file name: {0}" + "\nSelected file path: {1}", e.FileName, e.FilePath) , "OK"); } else { MessageBox.Show("In-window file picker result was \"Abort\"!", "Abort"); } }
private void FilePicker_DialogClosed(object sender, RoutedEventArgs e) { Width = origWidth; Height = origHeight; filePicker.Visibility = Visibility.Hidden; dragDrop.Margin = new Thickness(16); dropArea.Visibility = Visibility.Visible; btn_cancel.Visibility = Visibility.Visible; btn_ok.Visibility = Visibility.Visible; FilePickerClosedEventArgs args = e as FilePickerClosedEventArgs; if (args.Path != null) { tempOskPath = new FileInfo(args.Path); OskPath = tempOskPath.Name; } }
private void FolderPicker_DialogClosed(object sender, RoutedEventArgs e) { FilePickerClosedEventArgs args = e as FilePickerClosedEventArgs; if (args.Path != null) { SBCreatorViewModel vm = DataContext as SBCreatorViewModel; for (int i = 0; i < vm.DummyNames.Count; i++) { Helper.SaveImage((BitmapSource)vm.Animation[i], args.Path + "\\" + vm.DummyNames[i]); } string message = Helper.FindString("sb_sliderballSaved"); snackbar.MessageQueue.Enqueue(message, Helper.FindString("sb_sliderballSavedButton"), param => { Process.Start(new ProcessStartInfo { FileName = "explorer", Arguments = string.Format("/e, /select, \"{0}\"", args.Path + "\\" + vm.DummyNames[0]) }); }, message, false, true); } }
private void RaiseDialogClosedEvent(string path) { FilePickerClosedEventArgs eventArgs = new FilePickerClosedEventArgs(FilePicker.DialogClosedEvent, path); RaiseEvent(eventArgs); }
protected virtual void OnDialogClosed(FilePickerClosedEventArgs e) { DialogClosed?.Invoke(this, e); }