async void Handle_ItemSelected(object sender, Xamarin.Forms.SelectedItemChangedEventArgs e) { if (lsView.SelectedItem == null) { return; } var selectedContact = e.SelectedItem as Contact; lsView.SelectedItem = null; var page = new Views.ContactDetailPage(selectedContact); page.ContactUpdated += (source, contact) => { selectedContact.Id = contact.Id; selectedContact.FirstName = contact.FirstName; selectedContact.LastName = contact.LastName; selectedContact.ImageUrl = contact.ImageUrl; selectedContact.PhoneNumber = contact.PhoneNumber; selectedContact.Email = contact.Email; selectedContact.IsBlocked = contact.IsBlocked; }; await Navigation.PushAsync(page); }
async void OnAddContact(object sender, System.EventArgs e) { var page = new Views.ContactDetailPage(new Contact()); page.ContactAdded += (source, contact) => { _contacts[0].Add(contact); }; await Navigation.PushAsync(page); }