ContactLocationField ContactLocationField ContactLocationField ContactLocationField ContactLocationField Class

Definition

Contains information about a user's location and address.

public : sealed class ContactLocationField : IContactField, IContactLocationField
struct winrt::Windows::ApplicationModel::Contacts::ContactLocationField : IContactField, IContactLocationField
public sealed class ContactLocationField : IContactField, IContactLocationField
Public NotInheritable Class ContactLocationField Implements IContactField, IContactLocationField
var contactLocationField = new contactLocationField(unstructuredAddress);
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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) ContactLocationField(String)

Note

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

Creates a new ContactLocationField object.

ContactLocationField(String, ContactFieldCategory) 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.

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

Properties

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

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

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

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

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

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

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

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

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

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