// On iOS 7.x or earlier, a selected person is returned with this method.
		private void HandleSelectPerson (object sender, ABPeoplePickerSelectPersonEventArgs e)
		{
			var peoplePicker = (ABPeoplePickerNavigationController)sender;
			ResultLabel.Text = PersonFormatter.GetPickedName (e.Person);

			peoplePicker.DismissViewController (true, null);
			e.Continue = false;
		}
        // On iOS 7.x or earlier, a selected person is returned with this method.
        private void HandleSelectPerson(object sender, ABPeoplePickerSelectPersonEventArgs e)
        {
            var peoplePicker = (ABPeoplePickerNavigationController)sender;

            ResultLabel.Text = PersonFormatter.GetPickedName(e.Person);

            peoplePicker.DismissViewController(true, null);
            e.Continue = false;
        }
		// iOS7 and below
		void HandleSelectPerson (object sender, ABPeoplePickerSelectPersonEventArgs e)
		{
			var peoplePicker = (ABPeoplePickerNavigationController)sender;

			e.Continue = false;
			using (ABMultiValue<string> emails = e.Person.GetEmails ())
				e.Continue = emails.Count == 1;

			if (!e.Continue) {
				ResultLabel.Text = PersonFormatter.GetPickedEmail (e.Person);
				peoplePicker.DismissViewController (true, null);
			}
		}
        // iOS7 and below
        void HandleSelectPerson(object sender, ABPeoplePickerSelectPersonEventArgs e)
        {
            var peoplePicker = (ABPeoplePickerNavigationController)sender;

            e.Continue = false;
            using (ABMultiValue <string> emails = e.Person.GetEmails())
                e.Continue = emails.Count == 1;

            if (!e.Continue)
            {
                ResultLabel.Text = PersonFormatter.GetPickedEmail(e.Person);
                peoplePicker.DismissViewController(true, null);
            }
        }
Ejemplo n.º 5
0
        private void OnPersonSelected(object sender, ABPeoplePickerSelectPersonEventArgs e)
        {
            this.NameTextField.Text = e.Person.FirstName + " " + e.Person.LastName;
            if (e.Person.GetEmails ().Any()) {
                this.EmailTextField.Text = e.Person.GetEmails ().First ().Value;
            }

            if (e.Person.HasImage) {
                this.PhotoImageView.Image = UIImage.LoadFromData (e.Person.Image);
            }

            var picker = sender as ABPeoplePickerNavigationController;
            picker.DismissViewController (true, null);
        }