/// <summary>MVVMパターンでフォルダ選択ダイアログを表示します。</summary> private void ShowOokiiDialog_Click() { var dlgConfirm = new FolderSelectDialogConfirmation() { Title = "大きいDialog" }; if (this.commonDialogService.ShowDialog(dlgConfirm) == System.Windows.MessageBoxResult.OK) { this.SelectedFolderPath.Value = dlgConfirm.SelectedPath; } }
/// <summary> /// [参照] ボタン /// </summary> private void RaiseBrowseFolderCommand() { NewProjectNotification notification = _notification as NewProjectNotification; var folderNotification = new FolderSelectDialogConfirmation() { SelectedPath = notification.BaseFolderPath, RootFolder = Environment.SpecialFolder.Personal, ShowNewFolderButton = false, }; BrowseFolderRequest.Raise(folderNotification); if (folderNotification.Confirmed) { BaseFolderPath.Value = notification.BaseFolderPath = folderNotification.SelectedPath; } }
private void RaiseBrowseFolderCommand() { ThreeDBuildingNotification notification = _notification as ThreeDBuildingNotification; var folderNotification = new FolderSelectDialogConfirmation() { InitialDirectory = notification.ThreeDDataFolderPath, SelectedPath = notification.ThreeDDataFolderPath, RootFolder = Environment.SpecialFolder.Personal, ShowNewFolderButton = false }; BrowseFolderRequest.Raise(folderNotification); if (folderNotification.Confirmed) { this.ThreeDDataFolderPath.Value = notification.ThreeDDataFolderPath = folderNotification.SelectedPath;; } }
/// <summary> /// プロジェクトを開く /// </summary> void RaiseOpenFolderCommand() { var notification = new FolderSelectDialogConfirmation() { InitialDirectory = this.BaseFolderPath.Value, SelectedPath = this.BaseFolderPath.Value, RootFolder = Environment.SpecialFolder.Personal, ShowNewFolderButton = false }; OpenFolderRequest.Raise(notification); if (notification.Confirmed) { // SelectedPath の最後のディレクトリ名をプロジェクト名に // その前までをベースフォルダに int lastPos = notification.SelectedPath.LastIndexOf("\\"); this.BaseFolderPath.Value = notification.SelectedPath.Substring(0, lastPos + 1); this.ProjectName.Value = notification.SelectedPath.Substring(lastPos + 1); FileTree.Clear(); FileTree.Add(new FileTreeItem(this.ProjectFolderPath.Value)); } }