protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); EasyTracker.GetTracker().SendView("Settings View"); IDictionary <string, object> pageValues; if (QANavigationHelper.PageValues.TryGetValue(this.GetType().Name, out pageValues)) { object removePreviousPageFromHist; if (pageValues.TryGetValue(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY, out removePreviousPageFromHist)) { bool?removePreviousPage = removePreviousPageFromHist as bool?; if (removePreviousPage.HasValue) { if (removePreviousPage == true) { QANavigationHelper.RemoveBackEntry(); } } } } // Line to call event on view model PersistenceManager.Instance.PageNavigated(this.CurrentViewModel); }
// STEP: Add a Navigate method accepting a page name public void NavigateToPackagePage(Pack pack) { //if (pack.IsTerminated) //{ // Dictionary<string, object> parameters = new Dictionary<string, object>(); // parameters.Add(PackageCompletedPage.PAGE_PARAM_PACKID, pack.Id); // NavigationHelper.Navigate(typeof(PackageCompletedPage).Name, parameters); //} //else //{ Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add(GamePage.PAGE_PARAM_PACKID, pack.Id); if (AppSettings.Instance.HasHelpPageAlreadyBeSeen) { QANavigationHelper.Navigate(GamePage.PAGE_NAME, parameters); } else { Dictionary <string, object> parametersHelp = new Dictionary <string, object>(); parametersHelp.Add(HelpPage.PAGE_PARAM_NEXT_PAGE_NAME, typeof(GamePage).Name); parametersHelp.Add(HelpPage.PAGE_PARAM_NEXT_PAGE_PARAMS, parameters); QANavigationHelper.Navigate(typeof(HelpPage).Name, parametersHelp); AppSettings.Instance.HasHelpPageAlreadyBeSeen = true; } //} }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // retrieve parameters IDictionary <string, object> pageValues; if (QANavigationHelper.PageValues.TryGetValue(this.GetType().Name, out pageValues)) { object removePreviousPageFromHist; if (pageValues.TryGetValue(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY, out removePreviousPageFromHist)) { bool?removePreviousPage = removePreviousPageFromHist as bool?; if (removePreviousPage.HasValue) { if (removePreviousPage == true) { QANavigationHelper.RemoveBackEntry(); pageValues.Remove(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY); } } } } //if (e.NavigationMode == NavigationMode.Back) // this.CurrentViewModel.LoadAllDifficultiesAndLevels(); // Line to call event on view model PersistenceManager.Instance.PageNavigated(this.CurrentViewModel); EasyTracker.GetTracker().SendView("Levels Screen"); }
// STEP: Add a Navigate method accepting a page name public void NavigateToPacksListPage(int levelId) { Dictionary <string, object> par = new Dictionary <string, object>(); par.Add(PacksListPage.PAGE_PARAM_LEVEL_ID_INT, levelId); QANavigationHelper.Navigate(PacksListPage.PAGE_NAME, par); }
public void NavigateToPacksListPage(bool removePreviousPageFromHistory) { Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add(PacksListPage.PAGE_PARAM_LEVEL_ID_INT, (int)this.Pack.LevelId); parameters.Add(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY, (bool)removePreviousPageFromHistory); QANavigationHelper.Navigate(PacksListPage.PAGE_NAME, parameters); }
public void NavigateToHelpPage() { Dictionary <string, object> pageParams = new Dictionary <string, object>(); pageParams.Add(HelpPage.PAGE_PARAM_NEXT_PAGE_NAME, SettingsPage.PAGE_NAME); Dictionary <string, object> pageParams2 = new Dictionary <string, object>(); pageParams2.Add("essai", "toto"); pageParams.Add(HelpPage.PAGE_PARAM_NEXT_PAGE_PARAMS, pageParams2); QANavigationHelper.Navigate(HelpPage.PAGE_NAME, pageParams); }
public void GoToPreviousPage() { if (this.NextPageName != null && !string.IsNullOrEmpty(NextPageName)) { nextPageParams.Add(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY, true); QANavigationHelper.Navigate(nextPageName, nextPageParams); } else { Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY, true); QANavigationHelper.Navigate(MainPage.PAGE_NAME, parameters); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); EasyTracker.GetTracker().SendView("Game View"); // retrieve parameters if any, and set VM value IDictionary <string, object> pageValues; if (QANavigationHelper.PageValues.TryGetValue(this.GetType().Name, out pageValues)) { object propertyValue; if (pageValues.TryGetValue(QuizzApp.WP.ViewModels.Helpers.GamePage.PAGE_PARAM_PACKID, out propertyValue)) { int packId; if (int.TryParse(propertyValue.ToString(), out packId)) { this.CurrentViewModel.CurrentPackId = packId; } } object removePreviousPageFromHist; if (pageValues.TryGetValue(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY, out removePreviousPageFromHist)) { bool?removePreviousPage = removePreviousPageFromHist as bool?; if (removePreviousPage.HasValue) { if (removePreviousPage == true) { QANavigationHelper.RemoveBackEntry(); } } } } // Line to call event on view model PersistenceManager.Instance.PageNavigated(this.CurrentViewModel); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); IDictionary <string, object> pageValues; if (QANavigationHelper.PageValues.TryGetValue(this.GetType().Name, out pageValues)) { object propertyValue; if (pageValues.TryGetValue(QuizzApp.WP.ViewModels.Helpers.HelpPage.PAGE_PARAM_NEXT_PAGE_NAME, out propertyValue)) { this.CurrentViewModel.NextPageName = propertyValue.ToString(); if (pageValues.TryGetValue(QuizzApp.WP.ViewModels.Helpers.HelpPage.PAGE_PARAM_NEXT_PAGE_PARAMS, out propertyValue)) { this.CurrentViewModel.NextPageParams = propertyValue as Dictionary <string, object>; } } object removePreviousPageFromHist; if (pageValues.TryGetValue(QANavigationHelper.PAGE_PARAM_REMOVE_PREVIOUS_PAGE_FROM_HISTORY, out removePreviousPageFromHist)) { bool?removePreviousPage = removePreviousPageFromHist as bool?; if (removePreviousPage.HasValue) { if (removePreviousPage == true) { QANavigationHelper.RemoveBackEntry(); } } } } // Line to call event on view model PersistenceManager.Instance.PageNavigated(this.CurrentViewModel); EasyTracker.GetTracker().SendView("Help View"); }
public void NavigateToLevelsPage() { //NavigationHelper.Navigate(LevelsPage.PAGE_NAME); QANavigationHelper.Navigate(LevelsPage.PAGE_NAME); }
public void NavigateToAllPacksListPage() { //NavigationHelper.Navigate(LevelsPage.PAGE_NAME); QANavigationHelper.Navigate("LevelsPage3"); }
public void NavigateToSettingsPage() { QANavigationHelper.Navigate(SettingsPage.PAGE_NAME); }