private void SearchText_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Down && VideosView.SelectedIndex < VideosView.Items.Count) { VideosView.SelectedIndex += 1; } if (e.Key == Key.Up && VideosView.SelectedIndex > 0) { VideosView.SelectedIndex -= 1; } VideosView.ScrollIntoView(VideosView.SelectedItem); }
/// <summary> /// Shows the details view. /// </summary> public async Task ShowDetailsAsync() { if (CategoriesList.SelectedIndex < 0) { return; } SearchCategoryItem Item = CategoriesList.SelectedItem as SearchCategoryItem; if (Item.FilterType == SearchFilterEnum.None) { return; } if (Item.FilterValue == null && (Item.FilterType == SearchFilterEnum.Artist || Item.FilterType == SearchFilterEnum.Category || Item.FilterType == SearchFilterEnum.Element)) { // Change category group type. SearchGroupType = Item.FilterType; await LoadCategoriesAsync(); } else { // Open details view. IsDetailView = true; Settings.IsInDatabase = (Item.FilterType != SearchFilterEnum.Files); bool HasArtistColumn = (Item.FilterType != SearchFilterEnum.Artist || Item.FilterValue != "") && Item.FilterType != SearchFilterEnum.Files; ArtistColumn.Width = HasArtistColumn ? 80 : 0; Settings.FilterType = Item.FilterType; Settings.FilterValue = Item.FilterValue; Settings.DisplayCustomRating = (Item.FilterType == SearchFilterEnum.Element) ? Item.FilterValue : null; if (VideosView.HasItems) { VideosView.SelectedIndex = 0; VideosView.ScrollIntoView(VideosView.Items[0]); } await LoadDataAsync(); StoryboardOpenDetail.Seek(this, TimeSpan.Zero, TimeSeekOrigin.BeginTime); StoryboardOpenDetail.Begin(); ShowCategoryLabel(); } }