Esempio n. 1
0
        async void contacts_ItemSelected(System.Object sender, Xamarin.Forms.SelectedItemChangedEventArgs e)
        {
            if (contacts.SelectedItem == null)
            {
                return;
            }

            var selectedContact = e.SelectedItem as Contact;

            contacts.SelectedItem = null;

            var contactDetailPage = new ContactDetailPage(selectedContact);

            contactDetailPage.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(contactDetailPage);
        }
Esempio n. 2
0
        void Handle_ItemSelected(object sender, Xamarin.Forms.SelectedItemChangedEventArgs e)
        {
            var listView    = sender as ListView;
            var contact     = listView.SelectedItem as ContactClass;
            var contactPage = new ContactDetailPage();

            contactPage.BindingContext = contact;
            Navigation.PushAsync(contactPage);
        }
Esempio n. 3
0
        void Add_Clicked(System.Object sender, System.EventArgs e)
        {
            var contactPage = new ContactDetailPage(new Contact());

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

            Navigation.PushAsync(contactPage);
        }