Contains information about a user's location and address.
Syntax
var contactLocationField = new Windows.ApplicationModel.Contacts.ContactLocationField(string); var contactLocationField = new Windows.ApplicationModel.Contacts.ContactLocationField(string, contactFieldCategory); var contactLocationField = new Windows.ApplicationModel.Contacts.ContactLocationField(string, contactFieldCategory, string, string, string, string, string);
Attributes
- ActivatableAttribute(Windows.ApplicationModel.Contacts.IContactLocationFieldFactory, NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The ContactLocationField class has these types of members:
Constructors
The ContactLocationField class has these constructors.
| Constructor | Description |
|---|---|
| ContactLocationField(String) | Creates a new ContactLocationField object. |
| ContactLocationField(String, ContactFieldCategory) | Creates a new ContactLocationField object. |
| ContactLocationField(String, ContactFieldCategory, String, String, String, String, String) | Creates a new ContactLocationField object. |
Methods
The ContactLocationField class inherits methods from the Object class (C#/VB/C++).
Properties
The ContactLocationField class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the category for the contact data. | |
| Read-only | Gets the contact's city. | |
| Read-only | Gets the contact's country. | |
| Read-only | Gets the name of the field. | |
| Read-only | Gets the contact's postal code. | |
| Read-only | Gets the contact's region. | |
| Read-only | Gets the contact's street. | |
| Read-only | Gets the contact field type for the data. | |
| Read-only | Gets a string that represents an unstructured address. | |
| Read-only | Gets the value of the contact data. |
Remarks
Your app receives a collection of ContactLocationField objects when a contact provider returns the requested contact information. You can access these objects through the ContactInformation.Location property.
Examples
This code example demonstrates the use of the ContactInstantMessageField object.
function getLocation() { var picker = Windows.ApplicationModel.Contacts.ContactPicker(); picker.commitButtonText = "Select"; picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields; picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.location); picker.pickSingleContactAsync().then(function (contact) { var contactElement = document.createElement("div"); var contactData = contact.name + "<br/>"; contactData += contact.locations[0].city + "<br/>"; contactData += contact.locations[0].country + "<br/>"; contactData += contact.locations[0].postalcode + "<br/>"; contactData += contact.locations[0].region = "<br/>"; contactData += contact.locations[0].street + "<br/>"; contactData += contact.instantMessages[0].category + "<br/>"; contactData += contact.instantMessages[0].type; contactElement.innerHTML = contactData; 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