Storing Contacts in the Custom Contact Store

Beginning with Windows Phone 8, each Windows Phone app is provided with its own contact store. Your app can add or remove contacts from the store, and contacts that are present in the store are displayed in the phone’s People Hub.

The contact store is retrieved by calling the Windows.Phone.PersonalInformation.ContactStore class’s static CreateOrOpenAsync method. If the store does not exist, it is created the first time the method is called. To add a contact to the contact store, create a StoredContact instance and call its SaveAsync method, as demonstrated in the following example:

ContactStore store = await ContactStore.CreateOrOpenAsync();StoredContact contact = new ...

Get Windows® Phone 8 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.