private void PreviousPageHandler(object sender, MouseButtonEventArgs e) { CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass._currentPage = "1"; //Gets the Saved Instance of the first page and load it// Page page2 = CurrentPageModel.secondPage; if (page2 == null) { Page currentPage = new Page2(); this.NavigationService.Navigate(currentPage); //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage2.xaml", UriKind.RelativeOrAbsolute)); } else { this.NavigationService.Navigate(page2); WpfApp1.NavigationControls.NavigationControls secondControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.secondControl; secondControl.buttonManipulation(currentClass.currentpage); secondControl.PageNumber.Text = secondControl.currentPageNumber(currentClass.currentpage); } //Save the Instance of the thirdPage page// CurrentPageModel.thirdPage = this; //Save the Instance of the second page controls// CurrentPageModel.thirdControl = page3Controls; }
private void PreviousPageHandler(object sender, MouseButtonEventArgs e) { //Get the current instance of the navigation class CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass.currentpage = "4"; Page page5 = CurrentPageModel.fifthPage; if (page5 == null) { Page currentPage = new ProfileCreationPage5(); this.NavigationService.Navigate(currentPage); } else { //Load in the instance of the page this.NavigationService.Navigate(page5); //Load in the current navigation control WpfApp1.NavigationControls.NavigationControls fifthControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.fifthControl; //Set the button manipulation fifthControl.buttonManipulation(currentClass.currentpage); //Set the page number fifthControl.PageNumber.Text = fifthControl.currentPageNumber(currentClass.currentpage); } //Save current instance of the page CurrentPageModel.sixthPage = this; //Save current instance of the user control CurrentPageModel.sixthControl = page6Controls; }
private void PreviousPageHandler(object sender, MouseButtonEventArgs e) { //Get the current instance of the navigation class CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass.currentpage = "2"; Page page3 = CurrentPageModel.thirdPage; if (page3 == null) { Page currentPage = new ProfileCreationPage3(); this.NavigationService.Navigate(currentPage); //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage3.xaml", UriKind.RelativeOrAbsolute)); } else { //Load in the instance of the page this.NavigationService.Navigate(page3); //Load in the current navigation control WpfApp1.NavigationControls.NavigationControls thirdControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.thirdControl; //Set the button manipulation thirdControl.buttonManipulation(currentClass.currentpage); //Set the page number thirdControl.PageNumber.Text = thirdControl.currentPageNumber(currentClass.currentpage); } //Save current instance of the page CurrentPageModel.fourthPage = this; //Save current instance of the user control CurrentPageModel.fourthControl = page4Controls; }
private void NextPageHandler(object sender, MouseButtonEventArgs e) { Boolean isValidated = CurrentPageModel.secondValidation; string data = null; if (option1.IsChecked == true) { data = "a"; } if (option2.IsChecked == true) { data = "b"; } if (option3.IsChecked == true) { data = "c"; } if (option4.IsChecked == true) { data = "d"; } CurrentPageModel.secondValidation = true; UserModel.UserModel currentUserModel = UserModel.UserModel.currentUserModel; currentUserModel.profile2 = data; UserModel.UserModel.currentUserModel = currentUserModel; if (isValidated == true) { CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass._currentPage = "2"; Page page3 = CurrentPageModel.thirdPage; if (page3 == null) { Page currentPage = new ProfileCreationPage3(); this.NavigationService.Navigate(currentPage); } else { this.NavigationService.Navigate(page3); WpfApp1.NavigationControls.NavigationControls thirdControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.thirdControl; thirdControl.buttonManipulation(currentClass.currentpage); thirdControl.PageNumber.Text = thirdControl.currentPageNumber(currentClass.currentpage); } } else { MessageBox.Show("No option have been chosen. Please choose your option"); } //Save the Instance of the second page// CurrentPageModel.secondPage = this; //Save the Instance of the second page controls// CurrentPageModel.secondControl = page2Controls; }
private void NextPageHandler(object sender, MouseButtonEventArgs e) { //Get the current instance of the navigation class Boolean isValidated = CurrentPageModel.fifthhValidation; if (isValidated == true) { CurrentPageModel currentClass = CurrentPageModel.getcurrentclass(); currentClass.currentpage = "5"; Page page6 = CurrentPageModel.sixthPage; if (page6 == null) { Page currentPage = new ProfileCreationPage6(); this.NavigationService.Navigate(currentPage); //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage6.xaml", UriKind.RelativeOrAbsolute)); } else { Console.WriteLine("Hello"); //Load in the instance of the page this.NavigationService.Navigate(page6); //Load in the current navigation control WpfApp1.NavigationControls.NavigationControls sixthControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.sixthControl; //Set the button manipulation sixthControl.buttonManipulation(currentClass.currentpage); //Set the page number sixthControl.PageNumber.Text = sixthControl.currentPageNumber(currentClass.currentpage); } } else { MessageBox.Show("Button Game hasn't been completed. Please complete it first"); } //Save current instance of the page CurrentPageModel.fifthPage = this; //Save current instance of the user control CurrentPageModel.fifthControl = page5Controls; }