Esempio n. 1
0
        private void PreviousPageHandler(object sender, MouseButtonEventArgs e)
        {
            //Get the current instance of the navigation class
            CurrentPageModel currentClass = CurrentPageModel.getcurrentclass();

            currentClass.currentpage = "3";
            Page page4 = CurrentPageModel.fourthPage;

            if (page4 == null)
            {
                Page currentPage = new ProfileCreationPage4();
                this.NavigationService.Navigate(currentPage);
                //this.NavigationService.Navigate(new Uri(@"\ProfilePages\ProfileCreationPage4.xaml", UriKind.RelativeOrAbsolute));
            }
            else
            {
                //Load in the instance of the page
                this.NavigationService.Navigate(page4);
                //Load in the current navigation control
                WpfApp1.NavigationControls.NavigationControls fourthControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.fourthControl;
                //Set the button manipulation
                fourthControl.buttonManipulation(currentClass.currentpage);
                //Set the page number
                fourthControl.PageNumber.Text = fourthControl.currentPageNumber(currentClass.currentpage);
            }

            //Save current instance of the page
            CurrentPageModel.fifthPage = this;
            //Save current instance of the user control
            CurrentPageModel.fifthControl = page5Controls;
        }
Esempio n. 2
0
        private void NextPageHandler(object sender, MouseButtonEventArgs e)
        {
            Boolean isValidated = CurrentPageModel.thirdValidation;
            string  data        = null;

            if (option1.IsChecked == true)
            {
                data = "a";
            }
            if (option2.IsChecked == true)
            {
                data = "b";
            }
            if (option3.IsChecked == true)
            {
                data = "c";
            }

            UserModel.UserModel currentUserModel = UserModel.UserModel.currentUserModel;
            currentUserModel.profile3            = data;
            UserModel.UserModel.currentUserModel = currentUserModel;

            CurrentPageModel.secondValidation = true;

            if (isValidated == true)
            {
                CurrentPageModel currentClass = CurrentPageModel.getcurrentclass();
                currentClass._currentPage = "3";
                Page page4 = CurrentPageModel.fourthPage;
                if (page4 == null)
                {
                    Page currentPage = new ProfileCreationPage4();
                    this.NavigationService.Navigate(currentPage);
                }
                else
                {
                    this.NavigationService.Navigate(page4);
                    WpfApp1.NavigationControls.NavigationControls fourthControl = (WpfApp1.NavigationControls.NavigationControls)CurrentPageModel.fourthControl;
                    fourthControl.buttonManipulation(currentClass.currentpage);
                    fourthControl.PageNumber.Text = fourthControl.currentPageNumber(currentClass.currentpage);
                }
            }
            else
            {
                MessageBox.Show("No option have been chosen. Please choose your option");
            }

            //Save the Instance of the thirdPage page//
            CurrentPageModel.thirdPage = this;
            //Save the Instance of the second page controls//
            CurrentPageModel.thirdControl = page3Controls;
        }