In preparation for recording a session of Deep Fried Bytes on the WinRT Namespaces, I scanned through the public ones in the Developer Preview to see what I could find. One of the interesting ones that I hadn’t heard about yet is the Contact class in the Windows.ApplicationModel namespace. This appears to be preparing for an integrated contact experience similar to the one found on the people hub on the Windows Phone.
The ContactInformation object supports the following properties: Name, Locations (addresses), Emails, PhoneNumbers, InstantMessages, and CustomFields. Custom Fields support Name, Value, Category and Type. With this, you can handle a wide variety of information about your friends.
I was able to create some sample code to get a contact:
Dim contPicker As New Windows.ApplicationModel.Contacts.ContactPicker
Dim contact = Await contPicker.PickSingleContactAsync()
Dim contactName = contact.Name
Unfortunately, when running this code on the current bits, the following message appears.
I guess we’ll have to wait until the store opens and contact apps start appearing to use it, or will we. If you open the Package.AppManifest and navigate to the Declarations, you can add the Contact Picker declaration to your package and your own search page and algorithm to search your proprietary store similar to how you can enable your application to search files from Facebook, Skydrive, Flicker, etc.