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(); } }
private async void KeywordTextBox_OnGotFocus(object sender, RoutedEventArgs e) { if (AppContext.TrendingTags.IsNullOrEmpty()) { AppContext.TrendingTags.AddRange(await PixivClient.Instance.GetTrendingTags()); } TrendingTagPopup.OpenControl(); }
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(); } } }
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(); } } }