async Task ExecuteLoadTeamsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Teams.Clear();
                var items = await DataStoreTeam.GetItemsAsync(true);

                foreach (var item in items)
                {
                    Teams.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        public void ExecuteLoadEventTeamsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Teams.Clear();
                var teams = DataStoreTeam.GetItemsAsync(true).Result;
                foreach (var team in teams)
                {
                    Teams.Add(team);
                }
            }
            catch (Exception ex)
            {
                Title = ex.Message;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #3
0
        public void ExecuteLoadEventTeamsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                TeamResults.Clear();
                var teams = DataStoreTeam.GetItemsAsync(true).Result;
                foreach (var team in teams)
                {
                    TeamDetailViewModel matchViewModel = new TeamDetailViewModel(App.currFRCEventKey, team);
                    TeamResult          teamResult     = new TeamResult();
                    teamResult.TeamNumber        = team.TeamNumber;
                    teamResult.Name              = team.Name;
                    teamResult.TotalRP           = matchViewModel.TotalRP;
                    teamResult.TotalScore        = matchViewModel.TotalScore;
                    teamResult.AverageScore      = matchViewModel.AverageScore;
                    teamResult.TotalPowercells   = matchViewModel.TotalPowercells;
                    teamResult.AveragePowercells = matchViewModel.AveragePowercells;
                    teamResult.TotalBroken       = matchViewModel.TotalBroken;


                    TeamResults.Add(teamResult);
                }
            }
            catch (Exception ex)
            {
                Title = ex.Message;
            }
            finally
            {
                IsBusy = false;
            }
        }