// Edit user button
        private void EditUser_button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            if (users_listView.SelectedIndex != -1)
            {
                blindtest.setSelectedUser(selected_user, users_listView.SelectedIndex);

                this.Frame.Navigate(typeof(Pages.UserEditPage), blindtest);
            }

            else
            {
                editUser_button.Content = "You must select a user first!";
            }
        }
Esempio n. 2
0
        // Connect button
        private void Connect_button_Click(object sender, RoutedEventArgs e)
        {
            // If no item was selected in ListView
            if (users_listView.SelectedIndex == -1)
            {
                status_label.Text = "You must select a user first!";
            }

            else
            {
                // Check if password is given
                if (passwordBox.Password == "")
                {
                    status_label.Text = "You must type in your password!";
                }

                else
                {
                    // Check if password is valid, then connect
                    if (blindtest.connectUser(selected_user.user_id, passwordBox.Password, users_listView.SelectedIndex) == true)
                    {
                        status_label.Text = "connected!";
                        blindtest.setSelectedUser(selected_user, users_listView.SelectedIndex);
                        this.Frame.Navigate(typeof(Pages.PlayGameSelectionPage), blindtest);
                    }

                    else
                    {
                        status_label.Text = "Error: " + blindtest.getError();
                    }
                }
            }
        }