Beispiel #1
0
        private void ToolbarItem_Clicked(object sender, EventArgs e)
        {
            var page = new ContactDetailPageEj(null);

            page.ContactAdded += (source, contact) =>
            {
                contact.Id = _Contacts.Count + 1;
                _Contacts.Add(contact);
                Navigation.PopAsync();
            };

            Navigation.PushAsync(page);
        }
Beispiel #2
0
        private void listView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            var contactSelected = e.Item as ContactEj;
            var page            = new ContactDetailPageEj(contactSelected);

            listView.SelectedItem = null;

            page.ContactUpdate += (source, contact) =>
            {
                var oldContact = _Contacts.FirstOrDefault(c => c.Id == contact.Id);
                oldContact.FirstName = contact.FirstName;
                oldContact.LastName  = contact.LastName;
                oldContact.Blocked   = contact.Blocked;
                oldContact.Email     = contact.Email;
                oldContact.Phone     = contact.Phone;
                Navigation.PopAsync();
            };

            Navigation.PushAsync(page);
        }