EventAggrigationProvider added to handle events between windows/usercontrols, persons can be added now

This commit is contained in:
2020-05-17 21:23:45 +02:00
parent 94056f5f08
commit 8ae6337c00
5 changed files with 67 additions and 11 deletions

View File

@ -50,6 +50,12 @@ namespace TrackerWPFUI.ViewModels
}
}
public void CancelCreation()
{
EventAggregationProvider.TrackerEventAggregator.PublishOnUIThread(new PersonModel());
this.TryClose();
}
public bool CanCreatePerson(string firstName, string lastName, string email, string cellphone)
{
if(firstName.Length>0 && lastName.Length>0 && email.Length>0 && cellphone.Length > 0)
@ -74,6 +80,9 @@ namespace TrackerWPFUI.ViewModels
GlobalConfig.Connection.CreatePerson(p);
//TODO - Send results back to parent and close
EventAggregationProvider.TrackerEventAggregator.PublishOnUIThread(p);
this.TryClose();
}
}
}