示例#1
0
        private async void KeywordTextBox_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            if (!KeywordTextBox.Text.IsNullOrEmpty())
            {
                TrendingTagPopup.CloseControl();
            }

            if (QueryArtistToggleButton.IsChecked == true || QuerySingleArtistToggleButton.IsChecked == true || QuerySingleWorkToggleButton.IsChecked == true)
            {
                return;
            }

            var word = KeywordTextBox.Text;

            try
            {
                var result = await HttpClientFactory.AppApiService().GetAutoCompletion(new AutoCompletionRequest {
                    Word = word
                });

                if (result.Tags.Any())
                {
                    AutoCompletionPopup.OpenControl();
                    AutoCompletionListBox.ItemsSource = result.Tags.Select(p => new AutoCompletion {
                        Tag = p.Name, TranslatedName = p.TranslatedName
                    });
                }
            }
            catch (ApiException)
            {
                AutoCompletionPopup.CloseControl();
            }
        }
示例#2
0
 private async void KeywordTextBox_OnGotFocus(object sender, RoutedEventArgs e)
 {
     if (AppContext.TrendingTags.IsNullOrEmpty())
     {
         AppContext.TrendingTags.AddRange(await PixivClient.Instance.GetTrendingTags());
     }
     TrendingTagPopup.OpenControl();
 }
示例#3
0
 private void NavigatorList_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     TrendingTagPopup.CloseControl();
     if (NavigatorList.SelectedItem is ListViewItem current)
     {
         var translateTransform = (TranslateTransform)HomeDisplayContainer.RenderTransform;
         if (current == MenuTab && !translateTransform.Y.Equals(0))
         {
             HomeContainerMoveUp();
         }
         else if (current != MenuTab && translateTransform.Y.Equals(0))
         {
             HomeContainerMoveDown();
         }
     }
 }
示例#4
0
 private void NavigatorList_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     TrendingTagPopup.CloseControl();
     if (NavigatorList.SelectedItem is ListViewItem current)
     {
         var translateTransform = (TranslateTransform)HomeDisplayContainer.RenderTransform;
         if (current == MenuTab && !translateTransform.Y.Equals(0))
         {
             ReleaseItemsSource(SpotlightListView);
             ReleaseItemsSource(ImageListView);
             ReleaseItemsSource(UserPreviewListView);
             IteratingSchedule.CancelCurrent();
             HomeContainerMoveUp();
         }
         else if (current != MenuTab && translateTransform.Y.Equals(0))
         {
             HomeContainerMoveDown();
         }
     }
 }