public void RenderTopPlayedChampions(ChampionStatInfo[] topChampions) { ViewAggregatedStatsButton.IsEnabled = false; TopChampionsListView.Items.Clear(); if (!topChampions.Any()) { return; } TopChampionsLabel.Content = "Top Champions (" + topChampions[0].TotalGamesPlayed + " Ranked Games)"; foreach (var info in topChampions) { ViewAggregatedStatsButton.IsEnabled = true; if (!(Math.Abs(info.ChampionId) > 0)) { continue; } var champion = champions.GetChampion(Convert.ToInt32(info.ChampionId)); var player = new ChatPlayer { LevelLabel = {Visibility = Visibility.Hidden}, PlayerName = {Content = champion.displayName}, PlayerStatus = {Content = info.TotalGamesPlayed + " games played"}, ProfileImage = {Source = champions.GetChampion(champion.id).icon}, Background = new SolidColorBrush(Color.FromArgb(102, 80, 80, 80)), Height = 52, Width = 278 }; TopChampionsListView.Items.Add(player); } }
public void RenderTopPlayedChampions(ChampionStatInfo[] TopChampions) { ViewAggregatedStatsButton.IsEnabled = false; TopChampionsListView.Items.Clear(); if (TopChampions.Count() > 0) { TopChampionsLabel.Content = "Top Champions (" + TopChampions[0].TotalGamesPlayed + " Ranked Games)"; foreach (ChampionStatInfo info in TopChampions) { ViewAggregatedStatsButton.IsEnabled = true; if (info.ChampionId != 0.0) { ChatPlayer player = new ChatPlayer(); champions Champion = champions.GetChampion(Convert.ToInt32(info.ChampionId)); player.LevelLabel.Visibility = System.Windows.Visibility.Hidden; player.PlayerName.Content = Champion.displayName; player.PlayerStatus.Content = info.TotalGamesPlayed + " games played"; player.ProfileImage.Source = champions.GetChampion(Champion.id).icon; TopChampionsListView.Items.Add(player); } } } }