private void InitializeNewUser()
        {
            var userModel = new UserModel();

            UserEditorViewModel.InitializeEntity(userModel, true);
            //NOTE: to show how you can manually add validator
            UserEditorViewModel.AddValidator <UserEmailValidator>(userModel);
        }
        private void AddUser(object obj)
        {
            UserEditorViewModel.ApplyChanges();
            UserModel entity = UserEditorViewModel.Entity;

            UserGridViewModel.ItemsSource.Add(entity);
            UserGridViewModel.SelectedItem = entity;
            _userRepository.Add(entity);
            InitializeNewUser();
        }
        private async Task RemoveUser()
        {
            var selectedItem = UserGridViewModel.SelectedItem;

            if (await _messagePresenter.ShowAsync("Are you sure you want to remove the selected user?", string.Empty,
                                                  MessageButton.YesNo) != MessageResult.Yes)
            {
                return;
            }
            _userRepository.Remove(selectedItem);
            UserGridViewModel.ItemsSource.Remove(selectedItem);
            UserGridViewModel.SelectedItem = null;
            UserEditorViewModel.ValidateAsync();
        }
        private async void RemoveUser(object obj)
        {
            UserModel selectedItem = UserGridViewModel.SelectedItem;

            if (await _messagePresenter.ShowAsync("Are you sure you want to remove the selected user?", string.Empty,
                                                  MessageButton.YesNo) != MessageResult.Yes)
            {
                return;
            }
            _userRepository.Remove(selectedItem);
            UserGridViewModel.ItemsSource.Remove(selectedItem);
            UserGridViewModel.SelectedItem = null;
            // ReSharper disable once CSharpWarnings::CS4014
            UserEditorViewModel.ValidateAsync();
        }