public DirectoryCardV() { InitializeComponent(); this.WhenActivated(disposables => { this.DataContext = this.ViewModel; this.Bind(ViewModel, vm => vm.Name, v => v.Description.Text) .DisposeWith(disposables); Observable .FromEventPattern(PickDirectoryBtn, nameof(PickDirectoryBtn.Click)) .Select(_ => ViewModel.Directory) .Select(curPath => { var dialog = new VistaFolderBrowserDialog() { SelectedPath = curPath, }; return(dialog.ShowDialog() == true ? DirectoryPathVT.From(dialog.SelectedPath) : null); }) .WhereNotNull() .Subscribe(ViewModel.UpdateDirectoryPath) .DisposeWith(disposables); }); }
public static DirectoryPath operator +(DirectoryPath directory, RelativeDirectoryPath relativeDirectory) => DirectoryPath.From(Path.Combine(directory.Value, relativeDirectory.Value));
public DirectoryPath GetDirectoryPath() => DirectoryPath.From(Path.GetDirectoryName(Value));