Newbie
Newbie

Reputation: 1180

Windows phone - C# - Retrieving contact email

In my application I have a button which you can click on to send an email with certain contents. However I would like to know how to choose an email contact from the phones contacts, through some sort of contact-picker?

Is there any in-built contact-picker which I could use?

Thanks alot!

Upvotes: 1

Views: 206

Answers (1)

keyboardP
keyboardP

Reputation: 69372

You can use the EmailAddressChooserTask

EmailAddressChooserTask eact = new EmailAddressChooserTask();
eact.Completed += eact_Completed;
eact.Show();

void eact_Completed(object sender, EmailResult e)
{
    if (e.TaskResult == TaskResult.OK)
    { 
       string selectedEmail = e.Email;
    }
    else
    {
       //nothing chosen
    }      
}

Upvotes: 2

Related Questions