简体   繁体   中英

Updating WP7 ListBox

I have a webservice which contains a phone numbers. The phone queries the webservice to get the phones list and display them in a ListBox. The problem is that I do not know how to query the phone contacts database for every phone, get the contact name for it and show the name instead of the phone in the listbox.

Windows Phone SDK 7.1 gives you read-only access to the user's contact data, aggregated across the user's different accounts. For more information, see Contacts and Calendar for Windows Phone.

This MSDN article should get you started

And this should help too:

Contacts cont = new Contacts();
cont.SearchCompleted += (s, e) =>
    {
        foreach (var contact in e.Results)
        {
            string name = contact.DisplayName;
        }
    };
cont.SearchAsync("07000000000", FilterKind.PhoneNumber, null);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM