ContactLocationField ContactLocationField ContactLocationField ContactLocationField Class

Definition

Contains information about a user's location and address.

public sealed class ContactLocationFieldpublic sealed class ContactLocationFieldPublic NotInheritable Class ContactLocationFieldpublic sealed class ContactLocationField
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

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(String unstructuredAddress)public New(String unstructuredAddress)Public Sub New(unstructuredAddress As String)public ContactLocationField(String unstructuredAddress)
Parameters
unstructuredAddress
System.String System.String System.String System.String

The address of the contact in an unstructured format.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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(String unstructuredAddress, ContactFieldCategory category)public New(String unstructuredAddress, ContactFieldCategory category)Public Sub New(unstructuredAddress As String, category As ContactFieldCategory)public ContactLocationField(String unstructuredAddress, ContactFieldCategory category)
Parameters
unstructuredAddress
System.String System.String System.String System.String

The address of the contact in an unstructured format.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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(String unstructuredAddress, ContactFieldCategory category, String street, String city, String region, String country, String postalCode)public New(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)public ContactLocationField(String unstructuredAddress, ContactFieldCategory category, String street, String city, String region, String country, String postalCode)
Parameters
unstructuredAddress
System.String System.String System.String System.String

The address of the contact in an unstructured format.

street
System.String System.String System.String System.String

The street address of the contact.

city
System.String System.String System.String System.String

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

region
System.String System.String System.String System.String

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

country
System.String System.String System.String System.String

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

postalCode
System.String System.String System.String System.String

The postal code for this contact's address.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 ContactFieldCategorypublic ContactFieldCategory Category { get; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string City { get; }public string City { get; }Public ReadOnly Property City As stringpublic string City { get; }
Value
string string string string

The contact's city.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string Country { get; }public string Country { get; }Public ReadOnly Property Country As stringpublic string Country { get; }
Value
string string string string

The contact's country.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string Name { get; }public string Name { get; }Public ReadOnly Property Name As stringpublic string Name { get; }
Value
string string string string

The name of the field.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string PostalCode { get; }public string PostalCode { get; }Public ReadOnly Property PostalCode As stringpublic string PostalCode { get; }
Value
string string string string

The contact's postal code.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string Region { get; }public string Region { get; }Public ReadOnly Property Region As stringpublic string Region { get; }
Value
string string string string

The contact's region.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string Street { get; }public string Street { get; }Public ReadOnly Property Street As stringpublic string Street { get; }
Value
string string string string

The contact's street.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 ContactFieldTypepublic ContactFieldType Type { get; }
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string UnstructuredAddress { get; }public string UnstructuredAddress { get; }Public ReadOnly Property UnstructuredAddress As stringpublic string UnstructuredAddress { get; }
Value
string string string string

The address of the contact in an unstructured format.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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 string Value { get; }public string Value { get; }Public ReadOnly Property Value As stringpublic string Value { get; }
Value
string string string string

The value of the contact data.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)