ContactInformation class

1 out of 1 rated this helpful - Rate this topic

Contains the information about a contact.

Syntax


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

Attributes

VersionAttribute(NTDDI_WIN8)

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 Gets the thumbnail image for the contact.
QueryCustomFields 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-onlyA read-only list of the custom fields stored with the contact.

Emails

Read-onlyA read-only list of email addresses stored with the contact.

InstantMessages

Read-onlyA read-only list of instant messaging accounts stored with the contact.

Locations

Read-onlyA read-only list of locations stored with the contact.

Name

Read-onlyThe name of the contact.

PhoneNumbers

Read-onlyA read-only list of phone numbers stored with the contact.

 

Remarks

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() {
    var picker = Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.email);
    picker.pickSingleContactAsync().then(function (contact) {
        var contactElement = document.createElement("div");
        contactElement.innerText = contact.name + " " + contact.emails[0].value;
        document.body.appendChild(contactElement);
    });
}


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

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

Metadata

Windows.winmd

 

 

Build date: 12/4/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.