public IViewAdaper <SelectPathDialog, SelectPathDialogResult> GetSelectPathDialog(DirectoryItemType searchToLevel, string rootPath = "", string startPath = "", string fileExtantion = "") { SelectPathDialog dialog = new SelectPathDialog(); SelectPathViewModel viewModel = new SelectPathViewModel(this, searchToLevel, this.iOWrapper, rootPath, startPath, fileExtantion); dialog.DataContext = viewModel; return(new SelectPathDialogAdapter(dialog)); }
private void OnFolderBrowserClick(object window) { SelectPathDialog dialog = new SelectPathDialog(); SelectPathViewModel viewModel = new SelectPathViewModel(DirectoryItemType.Folder, PackagePath); dialog.DataContext = viewModel; dialog.Owner = window as Window; if (dialog.ShowDialog() == true) { this.PackagePath = viewModel.SelectedPath; } }
public void SaveCurrentSimulation() { DialogResult result = SelectPathDialog.ShowDialog(); SelectPathDialog.OverwritePrompt = true; if (result == DialogResult.OK) { string path = SelectPathDialog.FileName; if (path.Substring(path.Length - 5) == ".gols") { SimulationSaver.Save(simulation, path); } else { MessageBox.Show("Wrong file format! File name should end with '.gols'"); } } }