ContactInformation ContactInformation ContactInformation ContactInformation Class

Contains the information about a contact.

Syntax

Declaration

public sealed class ContactInformationpublic sealed class ContactInformationPublic NotInheritable Class ContactInformation

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

Windows 8@Windows.ApplicationModel.Contacts.ContactInformation propertyWindows 8.1@Windows.ApplicationModel.Contacts.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);
    });
}

Properties summary

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.

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.

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.

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.

Note

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

The name of the contact.

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 summary

Note

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

Gets the thumbnail image for the contact.

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.

Properties

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

    public IVectorView<ContactField> CustomFields { get; }public IVectorView<ContactField> CustomFields { get; }Public ReadOnly Property CustomFields As IVectorView<ContactField>

    Property Value

    • A read-only list of custom fields.

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

    public IVectorView<ContactField> Emails { get; }public IVectorView<ContactField> Emails { get; }Public ReadOnly Property Emails As IVectorView<ContactField>

    Property Value

    • A read-only list of email addresses.

    Remarks

    Use the Emails property to access a contact's email addresses from a ContactInformation object.

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

    public IVectorView<ContactInstantMessageField> InstantMessages { get; }public IVectorView<ContactInstantMessageField> InstantMessages { get; }Public ReadOnly Property InstantMessages As IVectorView<ContactInstantMessageField>

    Property Value

    • A read-only list of instant messaging accounts.

    Remarks

    Use the InstantMessages property to access a contact's instant messaging user names from a ContactInformation object.

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

    public IVectorView<ContactLocationField> Locations { get; }public IVectorView<ContactLocationField> Locations { get; }Public ReadOnly Property Locations As IVectorView<ContactLocationField>

    Property Value

    • A read-only list of locations.

    Remarks

    Use the Locations property to access a contact's address and other information from a ContactInformation object.

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

    public string Name { get; }public string Name { get; }Public ReadOnly Property Name As string

    Property Value

    • string
      string
      string
      string

      The name.

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

    public IVectorView<ContactField> PhoneNumbers { get; }public IVectorView<ContactField> PhoneNumbers { get; }Public ReadOnly Property PhoneNumbers As IVectorView<ContactField>

    Property Value

    • A read-only list of phone numbers.

Methods

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

    public IAsyncOperation<IRandomAccessStreamWithContentType> GetThumbnailAsync()public IAsyncOperation<IRandomAccessStreamWithContentType> GetThumbnailAsync()Public Function GetThumbnailAsync() As IAsyncOperation( Of IRandomAccessStreamWithContentType )

    Returns

    • An object that provides access to the thumbnail image.

  • QueryCustomFields(System.String)
    QueryCustomFields(System.String)
    QueryCustomFields(System.String)
    QueryCustomFields(System.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.

    public IVectorView<ContactField> QueryCustomFields(System.String customName)public IVectorView<ContactField> QueryCustomFields(System.String customName)Public Function QueryCustomFields(customName As System.String) As IVectorView( Of ContactField )

    Parameters

    • customName
      System.String
      System.String
      System.String
      System.String

      The name of the field.

    Returns

    • The value of the field.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.ApplicationModel.Contacts.dll