Controls how the Contact Picker user interface opens and what information it shows.
Syntax
var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker();
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- VersionAttribute(NTDDI_WIN8)
Members
The ContactPicker class has these types of members:
Constructors
The ContactPicker class has these constructors.
| Constructor | Description |
|---|---|
| ContactPicker | Creates a new instance of the ContactPicker class. |
Methods
The ContactPicker class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| PickMultipleContactsAsync | Launches the Contact Picker for selecting multiple contacts. |
| PickSingleContactAsync | Launches the Contact Picker for selecting a single contact. |
Properties
The ContactPicker class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write | Sets the text for the confirmation button in the Contact Picker user interface. | |
| Read-only | Sets the contact fields your app is interested in. | |
| Read/write | Controls whether the Contact Picker shows contacts as a complete entity or as a collection of fields. |
Remarks
The ContactPicker class enables users to select or more contacts from any app that supports the Contact Picker contract. You can configure the ContactPicker class to accept only a single contact, or multiple contacts. In addition, you can request that the app providing the contact information return the entire set of data for each contact, or just specific fields.
Examples
This example demonstrates using the ContactPicker to get the name and email address of a single 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 |
|
|
Metadata |
|
Build date: 12/4/2012