public async Task Resume() { await LoadData(false); await ChampionsView.Resume(); await ItemsView.Resume(); }
public async Task Refresh() { DataDragonService.InvalidateCache(); await LoadData(true); await ChampionsView.Refresh(); await ItemsView.Refresh(); }
private void OnSearchQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (args.ChosenSuggestion is ChampionSummary champion) { Pivot.SelectedIndex = 0; ChampionsView.Select(champion); } else if (args.ChosenSuggestion is Item item) { Pivot.SelectedIndex = 1; ItemsView.Select(item); } }
private void OnSearchTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var text = sender.Text.Trim(); var results = new List <Entity>(); if (text.Length > 0) { results.AddRange(ChampionsView.Search(text)); results.AddRange(ItemsView.Search(text)); results.Sort((a, b) => a.Name.CompareTo(b.Name)); if (results.Count == 0) { results.Add(PlaceholderSearchResult); } } sender.ItemsSource = results; } }