Contact.Fields Contact.Fields Contact.Fields Contact.Fields Contact.Fields Property

Definition

Note

Fields may be altered or unavailable for releases after Windows 8.1. Instead, use Phones, Emails, Addresses, or ConnectedServiceAccounts.

Sets the fields that contain information about a contact.

public : IVector<IContactField> Fields { get; }
IVector<IContactField> Fields();
public IList<IContactField> Fields { get; }
Public ReadOnly Property Fields As IList<IContactField>
var iList = contact.fields;
Property Value
IList<IContactField> IList<IContactField> IList<IContactField>

An array of fields containing information about a contact.

Additional features and requirements
Capabilities
contactsSystem

Examples

These functions show how you can add different fields to a Contact object.

function appendField(fields, value, type, category) {
    if (value) {
        fields.append(new Windows.ApplicationModel.Contacts.ContactField(value, type, category));
    }
}
function appendEmail(fields, email, category) {
    // Adds a new email to the contact fields vector
    appendField(fields, email, Windows.ApplicationModel.Contacts.ContactFieldType.email, category);
}
function appendPhoneNumber(fields, phone, category) {
    // Adds a new phone number to the contact fields vector
    appendField(fields, phone, Windows.ApplicationModel.Contacts.ContactFieldType.phoneNumber, category);
}
function appendAddress(fields, address, category) {
    // Adds a new address to the contact fields vector
    if (address) {
        fields.append(new Windows.ApplicationModel.Contacts.ContactLocationField(
                        address.full, category, address.street, address.city, address.state, "", address.zipCode));
    }
}

Remarks

The ContactFieldCategory and ContactFieldType classes provide information about what kind of information you can put into a field.