示例#1
0
        private async void CreateUser(object sender, RoutedEventArgs e)
        {
            var isUserCreated = await _createUserViewModel.CreateUser(nameInput.Text, (sex1.IsChecked.Value ? SexEnum.Man : SexEnum.Woman));

            if (isUserCreated)
            {
                Close();
            }
        }
示例#2
0
 private void ButtonSave(object sender, RoutedEventArgs e)
 {
     if (String.IsNullOrEmpty(Name.Text) || String.IsNullOrEmpty(Job.Text))
     {
         MessageBox.Show("Please enter a Name and Job.", "Validation Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else
     {
         _CreateUserViewModel.CreateUser();
         Close();
     }
 }