I am not able to find a way (even with Mango SDK) in which I can show a chooser (say PhoneNumberChooserTask), and get all details about a contact…
Only Name and PhoneNumber is available. For other information like address, I have to use a different chooser. Is there any way in which I can show a chooser (anyone) and get all details…
- Phone number
- Email address
- Photo of the contact
etc.
let me clarify the issue here…
The following code will not work. I want to show a chooser in such a way that it grabs all details. Showing multiple choosers, as I said is not what I want. Imagine asking someone to choose the same contact 3 times to get Email, PhoneNumber and Address.
EmailAddressChooserTask ect = new EmailAddressChooserTask(); ect.Completed += new EventHandler<EmailResult>(ect_Completed); ect.Show();
PhoneNumberChooserTask pct = new PhoneNumberChooserTask();
pct.Completed += new EventHandler<PhoneNumberResult>(pct_Completed);
pct.Show();
AddressChooserTask act = new AddressChooserTask();
act.Completed += new EventHandler<AddressResult>(act_Completed);
act.Show();
In v7.1 (Mango) you can use the Contacts class. You can use the SearchAsync method providing whatever search criteria you want (DisplayName is the most likely) and then handle the SearchCompleted event and use the ContactsSearchEventArgs.Results to access the returned Contact objects.
From there, you can use the GetPicture method to retrieve the contact image, and the various properties of the Contact object to access all the other information.
Hopefully that will get you started. You can find more information in the Microsoft.Phone.UserData namespace.