/// <summary> /// Called when [activated]. /// </summary> /// <param name="disposables">The disposables.</param> protected override void OnActivated(CompositeDisposable disposables) { BindOverlay(); ReactiveUI.MessageBus.Current.Listen <NavigationEventArgs>() .Subscribe(s => { ReactiveUI.MessageBus.Current.SendMessage(new ForceClosePopulsEventArgs()); switch (s.State) { case NavigationState.ConflictSolver: ConflictSolver.SelectedModCollection = s.SelectedCollection; ConflictSolver.SelectedModsOrder = s.SelectedMods; ConflictSolver.Conflicts = s.Results; ConflictSolver.Reset(); AnimateTransitionAsync(false).ConfigureAwait(true); break; default: AnimateTransitionAsync(true).ConfigureAwait(true); Main.Reset(); break; } }).DisposeWith(disposables); writingStateOperationHandler.Message.Subscribe(s => { TriggerPreventShutdown(!s.CanShutdown); }).DisposeWith(disposables); base.OnActivated(disposables); }
/// <summary> /// Called when [activated]. /// </summary> /// <param name="disposables">The disposables.</param> protected override void OnActivated(CompositeDisposable disposables) { var state = NavigationState.Main; BindOverlay(); ReactiveUI.MessageBus.Current.Listen <NavigationEventArgs>() .Subscribe(s => { ReactiveUI.MessageBus.Current.SendMessage(new ForceClosePopulsEventArgs()); state = s.State; switch (s.State) { case NavigationState.ConflictSolver: ConflictSolver.SelectedModCollection = s.SelectedCollection; ConflictSolver.SelectedModsOrder = s.SelectedMods; ConflictSolver.Conflicts = s.Results; ConflictSolver.Reset(); AnimateTransitionAsync(false).ConfigureAwait(true); break; default: AnimateTransitionAsync(true).ConfigureAwait(true); Main.Reset(); break; } }).DisposeWith(disposables); writingStateOperationHandler.Subscribe(s => { TriggerPreventShutdown(!s.CanShutdown); }).DisposeWith(disposables); RegisterHotkeyCommand = ReactiveCommand.CreateFromTask(async(string key) => { if (!OverlayVisible) { await hotkeyManager.HotKeyPressedAsync(state, key); } }).DisposeWith(disposables); base.OnActivated(disposables); }