Ejemplo n.º 1
0
        private void OnGameExited(int exitCode)
        {
            IsLaunching = false;
            LaunchProcessEnded?.Invoke();

            Execute.OnUIThread(() =>
            {
                GreetingVM.IsShown = true;

                if (_config.AfterLaunch != AfterLaunchBehavior.Exit && exitCode != 0)
                {
                    _errorReportVM.Setup(ErrorReportType.UnexpectedExit);
                    _windowManager.ShowDialog(_errorReportVM);
                }

                if (_config.AfterLaunch == AfterLaunchBehavior.Hide)
                {
                    _logService.Info(nameof(LaunchViewModel), "Restoring window");

                    Application.Current.MainWindow.Show();
                    Application.Current.MainWindow.Activate();
                }
            });
        }