/// <summary> /// Executes the ChooseFile command /// </summary> public void ChooseFolder() { try { var options = new FileAndFolderDialog.Abstractions.SelectFolderOptions() { Description = this.Description, ShowNewFolderButton = this.ShowNewFolderButton, SelectedPath = this.SelectedPath, RootFolder = this.RootFolder, }; var result = _folderDialogService.ShowSelectFolderDialog(options); if (string.IsNullOrEmpty(result)) { this.Result = null; } else { this.Result = result; } } catch (Exception ex) { this.Result = ex.Message; } }
} //design time only public SelectFolderDialogExampleViewModel(FileAndFolderDialog.Abstractions.IFolderDialogService folderDialogService) { this._folderDialogService = folderDialogService; //set defaults var options = new FileAndFolderDialog.Abstractions.SelectFolderOptions(); this.Description = options.Description; this.ShowNewFolderButton = options.ShowNewFolderButton; this.SelectedPath = options.SelectedPath; this.RootFolder = options.RootFolder; }