Exemple #1
0
        public async void OpenSeasonActionAsync()
        {
            var league = this;
            var matchs = await _openLigaService.LoadMatchesAsync(league.LeagueKey, league.SeasonKey);

            var matchViewModels = MatchViewModel.FromMatchs(matchs);
            var seasonViewModel = SeasonViewModel.From(matchViewModels, league.LeagueKey, league.SeasonKey);
            var tabViewModel    = new TabItemViewModel(league.ShortDisplayName,
                                                       league.ShortDisplayName, league.LongDisplayName,
                                                       seasonViewModel, true);

            var message = new TabMessage {
                Action = TabMessageAction.Create, ViewModel = tabViewModel
            };

            this.MessengerInstance.Send(message);
        }
        private async void ShowStatsAsync()
        {
            var    statsViewModel = ServiceLocator.Current.GetInstance <StatsViewModel>();
            var    task           = statsViewModel.CalulateForAsync(_leagueKey, _seasonKey);
            string caption        = $"stats-{_leagueKey}-{_seasonKey}";
            string tooltip        = "Stats for season ...";
            var    tabViewModel   = new TabItemViewModel(caption, caption, tooltip, statsViewModel);

            var message = new TabMessage
            {
                Action    = TabMessageAction.Create,
                ViewModel = tabViewModel,
            };
            await task;

            this.MessengerInstance.Send(message);
        }
Exemple #3
0
        private async void LoadTeamsActionAsync()
        {
            var teamsViewModel = ServiceLocator.Current.GetInstance <TeamsOfLeagueViewModel>();
            var task           = teamsViewModel.LoadTeamsAsync(this);

            var label        = $"Teams-{ShortDisplayName}";
            var tooltip      = $"Teams of {LongDisplayName}";
            var tabViewModel = new TabItemViewModel(label, label, tooltip, teamsViewModel, true);
            var tabMessage   = new TabMessage
            {
                ViewModel = tabViewModel,
                Action    = TabMessageAction.Create,
            };

            await task;

            this.MessengerInstance.Send(tabMessage);
        }