public MainWindowViewModel(IFlyoutService flyoutService, IEventAggregator eventAggregator, IGameSourceService gameSourceService,
                                   IGamesService gamesService)
        {
            _flyoutService = flyoutService;
            _gamesService  = gamesService;

            eventAggregator.GetEvent <SearchReadinessUpdated> ().Subscribe(sr => { IsSearchReady = sr; }, true);
            eventAggregator.GetEvent <GameCompletionUpdated> ().Subscribe(game => { CalculateShouldIStatus(); });
            eventAggregator.GetEvent <GameListUpdated> ().Subscribe(game => { CalculateShouldIStatus(); });

            WhenStateUpdated(() => IsSearchReady, () => {
                SearchReadinessMessage = IsSearchReady ? "GiantBomb search is ready." :
                                         "GiantBomb search is NOT ready. Please senter an API key in the settings or check your internet connection.";
            });
            IsSearchReady = gameSourceService.IsReady;
            CalculateShouldIStatus();
        }
Beispiel #2
0
        public GamesViewModel(IGamesService gamesService, IFlyoutService flyoutService, IGameSourceService gameSourceService,
                              IEventAggregator eventAggregator)
        {
            _gamesService  = gamesService;
            _flyoutService = flyoutService;
            IsSearchReady  = gameSourceService.IsReady;

            eventAggregator.GetEvent <SearchReadinessUpdated> ().Subscribe(sr => { IsSearchReady = sr; });
        }