public ModeSelectionVM(MainWindowVM mainVM) { _mainVM = mainVM; InstallCommand = ReactiveCommand.Create( execute: () => { var path = mainVM.Settings.Installer.LastInstalledListLocation; if (path == default || !path.Exists) { path = UIUtils.OpenFileDialog($"*{Consts.ModListExtension}|*{Consts.ModListExtension}"); } _mainVM.OpenInstaller(path); }); CompileCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Compiler.Value)); BrowseCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Gallery.Value)); }
public BackNavigatingVM(MainWindowVM mainWindowVM) { BackCommand = ReactiveCommand.Create( execute: () => Utils.CatchAndLog(() => mainWindowVM.NavigateTo(NavigateBackTarget)), canExecute: this.ConstructCanNavigateBack() .ObserveOnGuiThread()); _IsActive = this.ConstructIsActive(mainWindowVM) .ToGuiProperty(this, nameof(IsActive)); }
public ModeSelectionVM(MainWindowVM mainVM) { _mainVM = mainVM; InstallCommand = ReactiveCommand.Create( execute: () => { var path = mainVM.Settings.Installer.LastInstalledListLocation; if (string.IsNullOrWhiteSpace(path) || !File.Exists(path)) { path = UIUtils.OpenFileDialog($"*{ExtensionManager.Extension}|*{ExtensionManager.Extension}"); } _mainVM.OpenInstaller(path); }); CompileCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Compiler.Value)); BrowseCommand = ReactiveCommand.Create(() => mainVM.NavigateTo(mainVM.Gallery.Value)); }
public BackNavigatingVM(MainWindowVM mainWindowVM) { IsBackEnabled = IsBackEnabledSubject.StartWith(true); BackCommand = ReactiveCommand.Create( execute: () => Utils.CatchAndLog(() => { mainWindowVM.NavigateTo(NavigateBackTarget); Unload(); }), canExecute: this.ConstructCanNavigateBack() .ObserveOnGuiThread()); _IsActive = this.ConstructIsActive(mainWindowVM) .ToGuiProperty(this, nameof(IsActive)); }