public void GotSummoner(SummonerCache.Item item) { if (item == null) { Dispatcher.Invoke(() => SearchBox.BorderBrush = App.AwayBrush); } else if (!history.Contains(item)) { if (history.Count == 0) history.Add(item); else history.Insert(1, item); Dispatcher.MyInvoke(LoadSummoner, item); } }
private void GotSummoner(SummonerCache.Item item) { Dispatcher.Invoke(() => { if (item.Data != null) { ProfileIconImage.Source = DataDragon.GetProfileIconImage(DataDragon.GetIconData(item.Data.Summoner.ProfileIconId)).Load(); RankLabel.Content = "Level " + item.Data.SummonerLevel.Level; NameLabel.Content = item.Data.Summoner.Name; } if (item.Leagues != null) { var league = item.Leagues.SummonerLeagues.FirstOrDefault(l => l.Queue.Equals(QueueType.RANKED_SOLO_5x5.Key)); if (league != null) RankLabel.Content = RankedTier.Values[league.Tier] + " " + league.Rank; } }); }
private void LoadSummoner(SummonerCache.Item item) { SearchBox.BorderBrush = App.ForeBrush; HistoryList.SelectedItem = Selected = item; if (item.Data != null) { SummonerName.Content = item.Data.Summoner.Name; SummonerIcon.Source = DataDragon.GetProfileIconImage(DataDragon.GetIconData(item.Data.Summoner.ProfileIconId)).Load(); } if (item.MatchHistory != null) { MatchesPane.Child = new MatchHistory(item); } if (item.Data != null && item.Data.SummonerLevel.Level < 30) { SummonerRank.Content = "Level " + item.Data.SummonerLevel; } else if (item.Leagues != null) { var league = item.Leagues.SummonerLeagues.FirstOrDefault(l => l.Queue.Equals(QueueType.RANKED_SOLO_5x5.Key)); if (league != null) SummonerRank.Content = RankedTier.Values[league.Tier] + " " + league.Rank; } Profile_Click(ProfileTab, null); }
public MatchHistory(SummonerCache.Item item) { InitializeComponent(); MatchList.ItemsSource = item.MatchHistory.Games.Games.OrderByDescending(game => game.GameCreation); }
private void GotSummoner(SummonerCache.Item item) { Dispatcher.Invoke(() => { ProfileIconImage.Source = DataDragon.GetProfileIconImage(DataDragon.GetIconData(item.Data.Summoner.ProfileIconId)).Load(); NameLabel.Content = item.Data.Summoner.Name; }); }