DesiredFieldsWithContactFieldType | desiredFieldsWithContactFieldType property

ContactPicker.DesiredFieldsWithContactFieldType | desiredFieldsWithContactFieldType property

Gets the ways to connect with a contact.

Syntax


var desiredFieldsWithContactFieldType = contactPicker.desiredFieldsWithContactFieldType;

Property value

Type: IVector<ContactFieldType> [JavaScript/C++] | System.Collections.Generic.IList<ContactFieldType> [.NET]

An array of ContactFieldType-typed values for a contact.

Remarks

For info about how to select contacts, see Selecting contacts and Quickstart: Selecting user contacts (HTML).

Examples

This example demonstrates how to use the DesiredFieldsWithContactFieldType property to get only the email address of 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 (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

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

See also

Contact Picker app sample
ContactPicker

 

 

Show:
© 2016 Microsoft