Beispiel #1
0
        private void Register_Click(object sender, RoutedEventArgs e)
        {
            if (UsernameTxtBox.Text == string.Empty)
            {
                MessageBox.Show("UserName cannot be empty");
                return;
            }
            if (PasswdBox.Password.ToString() == string.Empty)
            {
                MessageBox.Show("Password cannot be null");
                return;
            }
            string sUserName = UsernameTxtBox.Text;
            string sPasswd   = PasswdBox.Password.ToString();
            //instance the event args and pass it each value
            RegisterProfileUpdateEventArgs args = new RegisterProfileUpdateEventArgs(sUserName, sPasswd);

            //raise the event with the updated arguments
            RegisterProfileUpdated(this, args);
            //close window;
            this.Close();
        }
Beispiel #2
0
 private void Register_ButtonClicked(object sender, RegisterProfileUpdateEventArgs e)
 {
     usernameBox.Text     = e.UserName;
     passwordBox.Password = e.Passwd;
 }