Windows Dev Center

ContactLocationField class

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

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The ContactLocationField class has these types of members:

Constructors

The ContactLocationField class has these constructors.

ConstructorDescription
ContactLocationField(String) IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Creates a new ContactLocationField object.
ContactLocationField(String,ContactFieldCategory) IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Creates a new ContactLocationField object.
ContactLocationField(String,ContactFieldCategory,String,String,String,String,String) IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Creates a new ContactLocationField object.

 

Properties

The ContactLocationField class has these properties.

PropertyAccess typeDescription

Category

Read-onlyIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. Gets the category for the contact data.

City

Read-onlyContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's city.

Country

Read-onlyContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's country.

Name

Read-onlyIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. Gets the name of the field.

PostalCode

Read-onlyContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's postal code.

Region

Read-onlyContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's region.

Street

Read-onlyContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets the contact's street.

Type

Read-onlyIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. Gets the contact field type for the data.

UnstructuredAddress

Read-onlyContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress. Gets a string that represents an unstructured address.

Value

Read-onlyIContactField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress, ContactPhone, ContactSignificantOther, Contact, ContactEmail, ContactConnectedServiceAccount, ContactWebsite, ContactJobInfo, or ContactDate. 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 (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 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

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

Object
IContactField

 

 

Show:
© 2015 Microsoft