예제 #1
0
        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);
        }
예제 #2
0
 public OpenGlobalSettings(
     GlobalSettingsPaneVm globalSettingsPaneVm,
     IActivePanelControllerVm activePanelControllerVm)
 {
     _globalSettingsPaneVm    = globalSettingsPaneVm;
     _activePanelControllerVm = activePanelControllerVm;
     OpenCommand = ReactiveCommand.Create(Open);
 }
예제 #3
0
 public GlobalSettingsPaneVm(
     ProfilesDisplayVm profilesDisplayVm,
     GlobalSettingsVm globalSettingsVm,
     IActivePanelControllerVm activePanelController)
 {
     GoBackCommand = ReactiveCommand.Create(() =>
     {
         activePanelController.ActivePanel = _previous;
     });
     Profiles = profilesDisplayVm;
     GlobalSettingsVm = globalSettingsVm;
 }
예제 #4
0
 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);