public QueryDetailZoom(ComicQuery comicQuery) { InitializeComponent(); comicQueryManager = FindResource("comicQueryManager") as ComicQueryManager; if (comicQuery != null) { comicQueryManager.UpdateQueryResults(comicQuery); Title = comicQueryManager.Title; } }
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count >= 1 && e.AddedItems[0] is ComicQuery) { comicQueryManager.CurrentQueryResults.Clear(); comicQueryManager.UpdateQueryResults(e.AddedItems[0] as ComicQuery); Title = title + ": " + comicQueryManager.Title; ComicQuery query = e.AddedItems[0] as ComicQuery; if (query.Title == "All comics in the collection") { QueryDetailZoom allComics = new QueryDetailZoom(query); allComics.Show(); } } }
public void UpdateQueryResults(ComicQuery query) { Title = query.Title; switch (query.Title) { case "LINQ makes queries easy": LinqMakesQueriesEasy(); break; case "Expensive Comics": ExpensiveComics(); break; case "LINQ is versatile 1": LinqIsVersatile1(); break; case "LINQ is versatile 2": LinqIsVersatile2(); break; case "LINQ is versatile 3": LinqIsVersatile3(); break; case "Group comics by price range": CombineJimmysValuesIntoGroups(); break; case "Join purchases with prices": JoinPurchaseWithPrices(); break; case "All comics in the collection": AllComics(); break; } }