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.

ContactPicker.SelectionMode | selectionMode property

Controls whether the Contact Picker shows contacts as a complete entity or as a collection of fields.

Syntax


var selectionMode = contactPicker.selectionMode;
contactPicker.selectionMode = selectionMode;

Property value

Type: ContactSelectionMode

The mode for the Contact Picker user interface. You can set this to Contacts or Fields.

Remarks

A contact can contain a lot of information. If you want all of this information, set the SelectionMode property to return the entire contact. If you are only interested in specific fields, set this property to return only a selection of fields, then use the DesiredFields property to specify which fields you want.

Use the ContactSelectionMode enumeration to set the value of this property.

Examples

This example demonstrates how to use the SelectionMode property.



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 (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

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

ContactPicker

 

 

Show:
© 2015 Microsoft