Beispiel #1
0
        private void LoginClickEvent(object sender, RoutedEventArgs e)
        {
            string username = UsernameBox.Text;
            string password = PasswordBox.Password;

            GameUser user = GameUser.GetUser(username, password);

            if (!IsUserValid(user, password))
            {
                return;
            }

            bool isAdmin = user.IsAdmin ?? false;

            if (isAdmin)
            {
                App.SwitchToWindow(this, "admin");
                return;
            }
            else
            {
                UserWindow userWindow = new UserWindow(user);
                this.Close();
                userWindow.Show();
                return;
            }
        }
        private void RedirectToUserProfile()
        {
            UserWindow userWindow = new UserWindow(currentUser);

            this.Close();
            userWindow.Show();
            return;
        }
Beispiel #3
0
        private void ToUserWindow(object sender, RoutedEventArgs e)
        {
            UserWindow userWindow = new UserWindow(currentUser);

            this.Close();
            userWindow.Show();
            return;
        }