Example #1
0
        public async Task Load(SeasonModel season)
        {
            this.season = season;
            if (season == null)
            {
                return;
            }

            try
            {
                IsLoading = true;
                var seasonStatisticSets = await LeagueContext.GetModelsAsync <SeasonStatisticSetModel>(season.SeasonStatisticSets.Select(x => x.ModelId));

                var leagueStatisticSets = await LeagueContext.GetModelsAsync <LeagueStatisticSetModel>();

                var loadedStatisticSets = seasonStatisticSets.Cast <StatisticSetModel>().Concat(leagueStatisticSets);
                statisticiSets.UpdateSource(loadedStatisticSets);
            }
            catch (Exception e)
            {
                GlobalSettings.LogError(e);
            }
            finally
            {
                IsLoading = false;
            }
        }