Example #1
0
        async void OnContactSelected(object sender, Xamarin.Forms.SelectedItemChangedEventArgs e)
        {
            if (contactsListView.SelectedItem == null)
            {
                return;
            }

            var selectedContact = e.SelectedItem as SQLiteContact;

            contactsListView.SelectedItem = null;

            var page = new ContactDetailsPage(selectedContact);

            page.ContactUpdated += (source, contact) =>
            {
                selectedContact.Id        = contact.Id;
                selectedContact.FirstName = contact.FirstName;
                selectedContact.LastName  = contact.LastName;
                selectedContact.Phone     = contact.Phone;
                selectedContact.Email     = contact.Email;
                selectedContact.IsBlocked = contact.IsBlocked;
            };

            await Navigation.PushAsync(page);
        }
Example #2
0
        async void OnAddContact(object sender, System.EventArgs e)
        {
            var page = new ContactDetailsPage(new SQLiteContact());

            page.ContactAdded += (source, contact) =>
            {
                _contacts.Add(contact);
            };

            await Navigation.PushAsync(page);
        }