Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ContactInformation class

Applies to Windows and Windows Phone

[ContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. ]

Contains the information about a contact.

Syntax


/* For information about creating or accessing this object, see Remarks. */

Attributes

[Deprecated()]
[Version(0x06020000)]

Members

The ContactInformation class has these types of members:

Methods

The ContactInformation class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
GetThumbnailAsync ContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. Gets the thumbnail image for the contact.
QueryCustomFields ContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. Enables you to get the value for a custom field that is stored with a contact.

 

Properties

The ContactInformation class has these properties.

PropertyAccess typeDescription

CustomFields

Read-onlyContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. A read-only list of the custom fields stored with the contact.

Emails

Read-onlyContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. A read-only list of email addresses stored with the contact.

InstantMessages

Read-onlyContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. A read-only list of instant messaging accounts stored with the contact.

Locations

Read-onlyContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. A read-only list of locations stored with the contact.

Name

Read-onlyContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. The name of the contact.

PhoneNumbers

Read-onlyContactInformation may be altered or unavailable for releases after Windows 8.1. Instead, use Contact. A read-only list of phone numbers stored with the contact.

 

Remarks

Note  Because you don't use PickSingleContactAsync and PickMultipleContactsAsync in your Windows 8.1 and later apps, you don't instantiate ContactInformation objects in your Windows 8.1 and later apps.

This table shows existing Windows 8 ContactInformation properties and their equivalent Windows 8.1 Contact properties.

Windows 8 ContactInformation propertyWindows 8.1 Contact property
Contact.NameContact.Name
Contact.ThumbnailContact.Thumbnail
Contact.FieldsContact.Emails
Contact.Fields where ContactField.Value = Address and ContactField.Category = ContactFieldCategory.Home or ContactFieldCategory.OtherContact.Addresses
Contact.FieldsContact.Phones
ContactField.ValueContactEmail.Address
ContactField.Category(Home,Work,Other)ContactEmail.Kind(Personal,Work,Other)
ContactField.ValueContactPhone.Number
ContactField.Category(Home, Work, Mobile, Other)ContactPhone.Kind(Home,Work,Mobile,Other)
Contact.Fields where ContactField.Value = CompanyAddress and ContactField.Category = ContactFieldCategory.WorkContactJobInfo.CompanyAddress

 

Typically, you access ContactInformation objects as the result of asynchronous method and/or function calls. For example, both of the static methods PickSingleContactAsync and PickMultipleContactsAsync return ContactInformation objects that represent the selected contact.

When your app receives contact information from a contact provider, the data for each contact is returned in a ContactInformation object.

Examples

This code demonstrates how a ContactInformation object is returned to an app after a user selects a contact.



function selectContact() {
    // Create the picker
    var picker = new Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFieldsWithContactFieldType.append(Windows.ApplicationModel.Contacts.ContactFieldType.email);    

    // Open the picker for the user to select a contact
    picker.pickContactAsync().done(function (contact) {
        var contactElement = document.createElement("div");
        contactElement.innerText = contact.name + " " + contact.emails[0].address;
        document.body.appendChild(contactElement);
    });
}



Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.ApplicationModel.Contacts
Windows::ApplicationModel::Contacts [C++]

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft