private async Task SelectContact(ContactViewModel contact)
        {
            if (contact == null)
            {
                return;
            }

            SelectedContact = null;

            var viewModel = new ContactDetailViewModel(contact, _contactStore, _pageService);

            viewModel.ContactUpdated += (source, updatedContact) =>
            {
                contact.id        = updatedContact.Id;
                contact.firstName = updatedContact.FirstName;
                contact.lastName  = updatedContact.LastName;
                contact.Phone     = updatedContact.Phone;
                contact.Email     = updatedContact.Email;
                contact.blocked   = updatedContact.IsBlocked;
            };

            await _pageService.PushAsync(new ContactDetail(viewModel));
        }
示例#2
0
 private void OnContactAdded(ContactDetailViewModel source, Contact contact)
 {
     Contacts.Add(new ContactViewModel(contact));
 }