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(); } }
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(); } }