ContactLocationField ContactLocationField ContactLocationField ContactLocationField Class

Definition

Contains information about a user's location and address.

public : sealed class ContactLocationField : IContactField, IContactLocationFieldpublic sealed class ContactLocationField : IContactField, IContactLocationFieldPublic NotInheritable Class ContactLocationField Implements IContactField, IContactLocationField// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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);
    });
}

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.

Constructors

ContactLocationField(String) ContactLocationField(String) ContactLocationField(String) ContactLocationField(String)

Note

IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Creates a new ContactLocationField object.

public : ContactLocationField(PlatForm::String unstructuredAddress)public ContactLocationField(String unstructuredAddress)Public Sub New(unstructuredAddress As String)// You can use this method in JavaScript.
Parameters
unstructuredAddress
PlatForm::String String String String

The address of the contact in an unstructured format.

See Also

ContactLocationField(String, ContactFieldCategory) ContactLocationField(String, ContactFieldCategory) ContactLocationField(String, ContactFieldCategory) ContactLocationField(String, ContactFieldCategory)

Note

IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Creates a new ContactLocationField object.

public : ContactLocationField(PlatForm::String unstructuredAddress, ContactFieldCategory category)public ContactLocationField(String unstructuredAddress, ContactFieldCategory category)Public Sub New(unstructuredAddress As String, category As ContactFieldCategory)// You can use this method in JavaScript.
Parameters
unstructuredAddress
PlatForm::String String String String

The address of the contact in an unstructured format.

See Also

ContactLocationField(String, ContactFieldCategory, String, String, String, String, String) ContactLocationField(String, ContactFieldCategory, String, String, String, String, String) ContactLocationField(String, ContactFieldCategory, String, String, String, String, String) ContactLocationField(String, ContactFieldCategory, String, String, String, String, String)

Note

IContactLocationFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Creates a new ContactLocationField object.

public : ContactLocationField(PlatForm::String unstructuredAddress, ContactFieldCategory category, PlatForm::String street, PlatForm::String city, PlatForm::String region, PlatForm::String country, PlatForm::String postalCode)public ContactLocationField(String unstructuredAddress, ContactFieldCategory category, String street, String city, String region, String country, String postalCode)Public Sub New(unstructuredAddress As String, category As ContactFieldCategory, street As String, city As String, region As String, country As String, postalCode As String)// You can use this method in JavaScript.
Parameters
unstructuredAddress
PlatForm::String String String String

The address of the contact in an unstructured format.

street
PlatForm::String String String String

The street address of the contact.

city
PlatForm::String String String String

The name of the city for this contact's address.

region
PlatForm::String String String String

The name of the region for this contact's address.

country
PlatForm::String String String String

The name of the country for this contact's address.

postalCode
PlatForm::String String String String

The postal code for this contact's address.

See Also

Properties

Category Category Category Category

Note

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

public : ContactFieldCategory Category { get; }public ContactFieldCategory Category { get; }Public ReadOnly Property Category As ContactFieldCategory// You can use this property in JavaScript.

Remarks

See the ContactFieldCategory class for more info on the available values for this property.

City City City City

Note

ContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Gets the contact's city.

public : PlatForm::String City { get; }public string City { get; }Public ReadOnly Property City As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The contact's city.

Country Country Country Country

Note

ContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Gets the contact's country.

public : PlatForm::String Country { get; }public string Country { get; }Public ReadOnly Property Country As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The contact's country.

Name Name Name Name

Note

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

public : PlatForm::String Name { get; }public string Name { get; }Public ReadOnly Property Name As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the field.

PostalCode PostalCode PostalCode PostalCode

Note

ContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Gets the contact's postal code.

public : PlatForm::String PostalCode { get; }public string PostalCode { get; }Public ReadOnly Property PostalCode As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The contact's postal code.

Region Region Region Region

Note

ContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Gets the contact's region.

public : PlatForm::String Region { get; }public string Region { get; }Public ReadOnly Property Region As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The contact's region.

Street Street Street Street

Note

ContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Gets the contact's street.

public : PlatForm::String Street { get; }public string Street { get; }Public ReadOnly Property Street As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The contact's street.

Type Type Type Type

Note

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

public : ContactFieldType Type { get; }public ContactFieldType Type { get; }Public ReadOnly Property Type As ContactFieldType// You can use this property in JavaScript.

Remarks

See the ContactFieldType class for more info on the available values for this property.

UnstructuredAddress UnstructuredAddress UnstructuredAddress UnstructuredAddress

Note

ContactLocationField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactAddress.

Gets a string that represents an unstructured address.

public : PlatForm::String UnstructuredAddress { get; }public string UnstructuredAddress { get; }Public ReadOnly Property UnstructuredAddress As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The address of the contact in an unstructured format.

Remarks

If the contact-providing application includes an address, but doesn't specify elements such as PostalCode or City, the data is put in the UnstructuredAddress property.

Value Value Value Value

Note

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

public : PlatForm::String Value { get; }public string Value { get; }Public ReadOnly Property Value As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The value of the contact data.