Beispiel #1
0
        private async Task LoadData()
        {
            IsAnalyzing            = true;
            HasNotification        = true;
            NotificationMessage    = Properties.Resources.NotificationLoading;
            PlayersTeam1Collection = CollectionViewSource.GetDefaultView(CurrentDemo.TeamCT.Players);
            PlayersTeam2Collection = CollectionViewSource.GetDefaultView(CurrentDemo.TeamT.Players);
            PlayersTeam1Collection.SortDescriptions.Add(new SortDescription("RatingHltv", ListSortDirection.Descending));
            PlayersTeam2Collection.SortDescriptions.Add(new SortDescription("RatingHltv", ListSortDirection.Descending));
            RoundsCollection = CollectionViewSource.GetDefaultView(CurrentDemo.Rounds);
            if (AppSettings.IsInternetConnectionAvailable() && CurrentDemo.Players.Any())
            {
                IEnumerable <string> steamIdList       = CurrentDemo.Players.Select(p => p.SteamId.ToString()).Distinct();
                List <PlayerSummary> playerSummaryList = await _steamService.GetUserSummaryAsync(steamIdList.ToList());

                foreach (PlayerSummary playerSummary in playerSummaryList)
                {
                    Player player = CurrentDemo.Players.FirstOrDefault(p => p.SteamId.ToString() == playerSummary.SteamId);
                    if (player != null)
                    {
                        player.AvatarUrl = playerSummary.AvatarFull;
                    }
                }
            }
            new ViewModelLocator().Settings.IsShowAllPlayers = true;
            UpdateDemosPagination();
            IsAnalyzing     = false;
            HasNotification = false;
        }