ContactInformation ContactInformation ContactInformation ContactInformation ContactInformation Class

Definition

Contains the information about a contact.

public : sealed class ContactInformation : IContactInformation
struct winrt::Windows::ApplicationModel::Contacts::ContactInformation : IContactInformation
public sealed class ContactInformation : IContactInformation
Public NotInheritable Class ContactInformation Implements IContactInformation
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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);
    });
}

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@Windows.ApplicationModel.Contacts.ContactInformation?text=ContactInformation properties and their equivalent Windows 8.1@Windows.ApplicationModel.Contacts.Contact?text=Contact properties.

Windows 8@Windows.ApplicationModel.Contacts.ContactInformation?text=ContactInformation propertyWindows 8.1@Windows.ApplicationModel.Contacts.Contact?text=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.

Properties

CustomFields CustomFields CustomFields CustomFields CustomFields

Note

ContactInformation 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 Emails Emails Emails Emails

Note

ContactInformation 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 InstantMessages InstantMessages InstantMessages InstantMessages

Note

ContactInformation 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 Locations Locations Locations Locations

Note

ContactInformation 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 Name Name Name Name

Note

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

The name of the contact.

PhoneNumbers PhoneNumbers PhoneNumbers PhoneNumbers PhoneNumbers

Note

ContactInformation 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.

Methods

GetThumbnailAsync() GetThumbnailAsync() GetThumbnailAsync() GetThumbnailAsync() GetThumbnailAsync()

Note

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

Gets the thumbnail image for the contact.

QueryCustomFields(String) QueryCustomFields(String) QueryCustomFields(String) QueryCustomFields(String) QueryCustomFields(String)

Note

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.