private void OnSelectionChanged(object sender, SelectionChangedEventArgs args) { if (CatalogueList.SelectedIndex < 0 || !IsLoaded) { return; } switch (PageType) { case LibraryModel.LibraryLevel.Catalogue: { string nextPageId = (CatalogueList.SelectedItem as LibraryModelItem).Id; App.Engine.StatisticsManager.LogCatalogueOpen(nextPageId); NavigationService.Navigate(new Uri("/CataloguePage.xaml?id=" + nextPageId, UriKind.Relative)); break; } case LibraryModel.LibraryLevel.Category: { string nextPageId = (CatalogueList.SelectedItem as LibraryModelItem).Id; App.Engine.StatisticsManager.LogCategoryOpen(nextPageId); NavigationService.Navigate(new Uri("/CataloguePage.xaml?id=" + nextPageId, UriKind.Relative)); break; } case LibraryModel.LibraryLevel.MediaItemsList: MediaItemRequestedCommand.GetCommand().Execute(CatalogueList.SelectedItem as MediaItemsListModelItem); break; default: break; } CatalogueList.SelectedIndex = -1; // Reset selection }
private void OnSelectionChanged(object sender, SelectionChangedEventArgs args) { if (SearchList.SelectedIndex < 0 || !IsSearchListLoaded) { return; } MediaItemRequestedCommand.GetCommand().Execute(SearchList.SelectedItem as MediaItemsListModelItem); SearchList.SelectedIndex = -1; // Reset selection }