Пример #1
0
        private void OnChoiceExecute(long id)
        {
            TournamentVw.CheckFlag = true;
            TournamentVw._instances.Clear();
            if (TournamentMatches != null && TournamentMatches.Count > 0)
            {
                TournamentMatches = null;
            }
            if (SelectedTournaments != null && SelectedTournaments.Count > 0)
            {
                SelectedTournaments.Clear();
            }
            var category = Categories.Where(c => c.Id == id).FirstOrDefault();

            SelectedSportDescriptor = category.SportDescriptor;
            ButtonBackground        = category.BackgroundBySport;
            var tournamentsData = new TournamentsViewModel(id);

            tournamentsData.OnNavigationCompleted();
            Tournaments              = new SortableObservableCollection <TournamentVw>(tournamentsData.Tournaments);
            ShowCountries            = new SortableObservableCollection <TournamentVw>(Tournaments.GroupBy(p => p.Country).Select(g => g.First()).ToList());
            ShowCountries[0].Country = "Outrights";
            SelectedCategoryId       = id;
            TournamentVw.CheckFlag   = false;
        }