public AddContactViewModel(INavigation navigation) { _navigation = navigation; _contactValidator = new ContactValidator(); _contact = new ContactInfo(); _contactRepository = new ContactRepository(); AddContactCommand = new Command(async() => await AddContact()); ViewAllContactsCommand = new Command(async() => await ShowContactList()); }
public DetailsViewModel(INavigation navigation, int selectedContactID) { _navigation = navigation; _contactValidator = new ContactValidator(); _contact = new ContactInfo(); _contact.Id = selectedContactID; _contactRepository = new ContactRepository(); UpdateContactCommand = new Command(async() => await UpdateContact()); DeleteContactCommand = new Command(async() => await DeleteContact()); FetchContactDetails(); }