Beispiel #1
0
 private void sign_in_Click(object sender, RoutedEventArgs e)
 {
     if (verifyId_Password(this.login.Text, this.password.Password))
     {
         ((WindowViewModel)WindowViewModel.GetWindow().DataContext).CurrentPage = PageType.HomePage;
         ((WindowViewModel)WindowViewModel.GetWindow().DataContext).OnPropertyChanged("CurrentPage");
     }
     else
     {
         MessageBox.Show("Uncorrect Login or Password - Try again");
     }
 }
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // Find the appropriate page
            //ApplicationPage page = (ApplicationPage)value;
            switch ((PageType)value)
            {
            case PageType.Login:
                ((MainWindow)WindowViewModel.GetWindow()).setVisibilitySt_panel(false);
                return(new LoginPage());

            case PageType.HomePage:
                ((MainWindow)WindowViewModel.GetWindow()).setVisibilitySt_panel(true);
                return(new HomePage());

            case PageType.GameSettingPage:
                ((MainWindow)WindowViewModel.GetWindow()).setVisibilitySt_panel(true);
                return(new GameSettingPage());

            case PageType.ProfilSettingPage:
                ((MainWindow)WindowViewModel.GetWindow()).setVisibilitySt_panel(true);
                return(new ProfileSettingPage());

            case PageType.NewUser:
                ((MainWindow)WindowViewModel.GetWindow()).setVisibilitySt_panel(false);
                return(new NewUserPage());

            case PageType.ForgetPasswordPage:
                ((MainWindow)WindowViewModel.GetWindow()).setVisibilitySt_panel(false);
                return(new ForgetPasswordPage());

            case PageType.NewsPage:
                ((MainWindow)WindowViewModel.GetWindow()).setVisibilitySt_panel(true);
                return(new NewsPage());

            default:
                Debugger.Break();
                return(null);
            }
        }
Beispiel #3
0
 //Ask for the mail address of the user and send him an email with a random password
 //He has to reconnect with the random password and has to change his old password
 private void Forget_password_Click(object sender, RoutedEventArgs e)
 {
     ((WindowViewModel)WindowViewModel.GetWindow().DataContext).CurrentPage = PageType.ForgetPasswordPage;
     ((WindowViewModel)WindowViewModel.GetWindow().DataContext).OnPropertyChanged("CurrentPage");
 }
Beispiel #4
0
 private void sign_up_Click(object sender, RoutedEventArgs e)
 {
     ((WindowViewModel)WindowViewModel.GetWindow().DataContext).CurrentPage = PageType.NewUser;
     ((WindowViewModel)WindowViewModel.GetWindow().DataContext).OnPropertyChanged("CurrentPage");
 }