public void SetChampionImage() { string championName = AppConstants.championsData.keys[game.championId.ToString()]; ChampionStatic champion = AppConstants.championsData.data[championName]; ChampionImage = AppConstants.SetImageSource(new Uri(AppConstants.ChampionIconUrl() + champion.image.full)); }
void RefreshChampionsCollection() { championsCollection.Clear(); if (selectedRole == "All") { foreach (KeyValuePair <string, ChampionStatic> champion in sortedChampions) { if (screenHeight >= 1440) { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.championLoadingUrl + champion.Key + "_0.jpg"), 308, 560, champion.Key, champion.Value)); } else { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.ChampionIconUrl() + champion.Key + ".png"), 120, 120, champion.Key, champion.Value)); } } } else { foreach (KeyValuePair <string, ChampionStatic> champion in sortedChampions) { if (champion.Value.tags[0] == selectedRole) { if (screenHeight >= 1440) { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.championLoadingUrl + champion.Key + "_0.jpg"), 308, 560, champion.Key, champion.Value)); } else { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.ChampionIconUrl() + champion.Key + ".png"), 120, 120, champion.Key, champion.Value)); } } } } }
private void championSearchBox_SuggestionsRequested(SearchBox sender, SearchBoxSuggestionsRequestedEventArgs args) { string search = args.QueryText; if (search != "") { SearchSuggestionCollection suggestionCollegion = args.Request.SearchSuggestionCollection; championsCollection.Clear(); foreach (KeyValuePair <string, ChampionStatic> champion in sortedChampions) { if (champion.Value.name.ToLower().Contains(search.ToLower())) { if (selectedRole == "All") { suggestionCollegion.AppendQuerySuggestion(champion.Value.name); if (screenHeight >= 1440) { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.championLoadingUrl + champion.Key + "_0.jpg"), 308, 560, champion.Key, champion.Value)); } else { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.ChampionIconUrl() + champion.Key + ".png"), 120, 120, champion.Key, champion.Value)); } } else { if (champion.Value.tags[0] == selectedRole) { suggestionCollegion.AppendQuerySuggestion(champion.Value.name); if (screenHeight >= 1440) { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.championLoadingUrl + champion.Key + "_0.jpg"), 308, 560, champion.Key, champion.Value)); } else { championsCollection.Add(new ChampionsGridViewBinding(new Uri(AppConstants.ChampionIconUrl() + champion.Key + ".png"), 120, 120, champion.Key, champion.Value)); } } } } } } else { RefreshChampionsCollection(); } }