Example #1
0
        private async void OnSave()
        {
            var editingRelatedPerson = Mapper.Map <EditableRelatedPerson, RelatedPerson>(RelatedPerson);

            try
            {
                if (EditMode)
                {
                    await _relatedPeopleService.UpdateRelatedPersonAsync(editingRelatedPerson);
                }
                else
                {
                    await _relatedPeopleService.AddRelatedPersonAsync(editingRelatedPerson);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed?.Invoke(ex);
            }
            finally
            {
                RelatedPerson = null;
            }
        }
Example #2
0
 public void SetRelatedPerson(RelatedPerson relatedPerson)
 {
     RelatedPerson = Mapper.Map <RelatedPerson, EditableRelatedPerson>(relatedPerson);
     RelatedPerson.ErrorsChanged += RaiseCanExecuteChanged;
 }