public ActiveRunVm(IActivePanelControllerVm activePanelController) { this.WhenAnyValue(x => x.CurrentRun) .Do(run => { if (run != null) { activePanelController.ActivePanel = run; } }) .ObserveOn(RxApp.TaskpoolScheduler) .StartWith(default(RunVm?)) .Pairwise() .Subscribe(async r => { if (r.Previous != null) { if (r.Previous.Running) { await r.Previous.Cancel().ConfigureAwait(false); } r.Previous.Dispose(); } if (r.Current != null) { await r.Current.Run().ConfigureAwait(false); } }) .DisposeWith(this); }
public OpenGlobalSettings( GlobalSettingsPaneVm globalSettingsPaneVm, IActivePanelControllerVm activePanelControllerVm) { _globalSettingsPaneVm = globalSettingsPaneVm; _activePanelControllerVm = activePanelControllerVm; OpenCommand = ReactiveCommand.Create(Open); }
public GlobalSettingsPaneVm( ProfilesDisplayVm profilesDisplayVm, GlobalSettingsVm globalSettingsVm, IActivePanelControllerVm activePanelController) { GoBackCommand = ReactiveCommand.Create(() => { activePanelController.ActivePanel = _previous; }); Profiles = profilesDisplayVm; GlobalSettingsVm = globalSettingsVm; }
public MainVm( ActiveRunVm activeRunVm, ProfileManagerVm profileManager, OpenProfileSettings openProfileSettings, OpenGlobalSettings openGlobalSettings, IConfirmationPanelControllerVm confirmationControllerVm, IProvideCurrentVersions currentVersions, ISelectedProfileControllerVm selectedProfile, ISaveSignal saveSignal, ISettingsSingleton settingsSingleton, INewestLibraryVersionsVm libVersionsVm, IActivePanelControllerVm activePanelControllerVm, IProfileFactory profileFactory, ILogger logger) { logger.Information("Creating MainVM"); _selectedProfileController = selectedProfile; _settingsSingleton = settingsSingleton; _activePanelControllerVm = activePanelControllerVm; _profileFactory = profileFactory; _logger = logger; _activePanel = activePanelControllerVm.WhenAnyValue(x => x.ActivePanel) .ToGuiProperty(this, nameof(ActivePanel), default, deferSubscription: true);