public bool UserRegistration()
 {
     if (chatUser.Login != "" && chatUser.Login != null)
     {
         if (client.UserRegistration(chatUser))
         {
             return(true);
         }
     }
     return(false);
 }
        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            string username = txtRegUsername.Text;
            string email    = txtRegEmail.Text;
            string password = txtRegPassword.Password;
            //MessageBox.Show((username + " " + email + " " + password));
            bool registration = client.UserRegistration(username, email, password);

            if (registration)
            {
                btnToAutorization(sender, e);
                MessageBox.Show("You successfully registered");
            }
            else
            {
                MessageBox.Show("This username or e-mail already exists");
            }
        }