/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> async protected override void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { await Suspension_manager.RestoreAsync(); } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (e.PrelaunchActivated == false) { if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MainPage), e.Arguments); } if (!String.IsNullOrEmpty(Suspension_manager.CurrentQuery)) { var currentQuerySeq = from query in new ComicQueryManager().AvailableQueries where query.Title == Suspension_manager.CurrentQuery select query; if (currentQuerySeq.Count() == 1) { ComicQuery query = currentQuerySeq.First(); if (query != null) { if (query.Title == "Wszystkie komiksy") { rootFrame.Navigate(typeof(QueryZoom), query); } else { rootFrame.Navigate(typeof(QueryDetail), query); } } } } // Ensure the current window is active Window.Current.Activate(); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { ComicQuery comicQuery = e.Parameter as ComicQuery; if (comicQuery != null) { comicQueryManager.UpdateQueryResults(comicQuery); } base.OnNavigatedTo(e); }
public void UpdateQueryResults(ComicQuery query) { Title = query.Title; switch (query.Title) {//use it to execute clicked query. case "ponizej 500zl": CheapComics(); break; case "Drogie komiksy": ExpensiveComics(); break; case "grupuj wedlug ceny": GroupByPrice(); break; case "Polacz zakupy z cenami": Polacz(); break; case "Zobacz Wszystkie komiksy": AllComics(); break; } }
//when list view click event will happen then.. private void ListView_ItemClick(object sender, ItemClickEventArgs e) { ComicQuery query = e.ClickedItem as ComicQuery; if (query != null) { Suspension_manager.CurrentQuery = query.Title;//save chosen query in purpose to restore if needed. if (query.Title == "Zobacz Wszystkie komiksy") { this.Frame.Navigate(typeof(QueryZoom), query); //if will be chosen see all comics with zoom option query then move to specific page } else//move to standard page with results without zoom option { this.Frame.Navigate(typeof(QueryDetail), query); } } }