示例#1
0
        public async Task Resume()
        {
            await LoadData(false);

            await ChampionsView.Resume();

            await ItemsView.Resume();
        }
示例#2
0
        public async Task Refresh()
        {
            DataDragonService.InvalidateCache();
            await LoadData(true);

            await ChampionsView.Refresh();

            await ItemsView.Refresh();
        }
示例#3
0
 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);
     }
 }
示例#4
0
        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;
            }
        }