Contact​Location​Field Contact​Location​Field Contact​Location​Field 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
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 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);
    });
}

Constructors

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

The address of the contact in an unstructured format.

Attributes

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

The address of the contact in an unstructured format.

category
ContactFieldCategory ContactFieldCategory ContactFieldCategory

The category the field belongs to.

Attributes

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 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)
Parameters
unstructuredAddress
System.String System.String System.String

The address of the contact in an unstructured format.

category
ContactFieldCategory ContactFieldCategory ContactFieldCategory

The category for the contact data.

street
System.String System.String System.String

The street address of the contact.

city
System.String System.String System.String

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

region
System.String System.String System.String

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

country
System.String System.String System.String

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

postalCode
System.String System.String System.String

The postal code for this contact's address.

Attributes

Properties

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
Value
ContactFieldCategory ContactFieldCategory ContactFieldCategory

The category for the contact data.

Attributes

Remarks

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

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 string
Value
string string string

The contact's city.

Attributes

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 string
Value
string string string

The contact's country.

Attributes

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 string
Value
string string string

The name of the field.

Attributes

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 string
Value
string string string

The contact's postal code.

Attributes

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 string
Value
string string string

The contact's region.

Attributes

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 string
Value
string string string

The contact's street.

Attributes

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
Attributes

Remarks

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

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 string
Value
string string string

The address of the contact in an unstructured format.

Attributes

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

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 string
Value
string string string

The value of the contact data.

Attributes