ContactLocationField class

This topic has not yet been rated - Rate this topic

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.

ConstructorDescription
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.

PropertyAccess typeDescription

Category

Read-onlyGets the category for the contact data.

City

Read-onlyGets the contact's city.

Country

Read-onlyGets the contact's country.

Name

Read-onlyGets the name of the field.

PostalCode

Read-onlyGets the contact's postal code.

Region

Read-onlyGets the contact's region.

Street

Read-onlyGets the contact's street.

Type

Read-onlyGets the contact field type for the data.

UnstructuredAddress

Read-onlyGets a string that represents an unstructured address.

Value

Read-onlyGets 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

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.