ContactField ContactField ContactField ContactField ContactField Class

Definition

Describes a piece of contact data.

public : sealed class ContactField : IContactField
struct winrt::Windows::ApplicationModel::Contacts::ContactField : IContactField
public sealed class ContactField : IContactField
Public NotInheritable Class ContactField Implements IContactField
var contactField = new contactField(name, value, type, category);
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

Examples

This example demonstrates how to create a ContactField object and add it to a contact.

function contactFieldTest() {
    var contact = new Windows.ApplicationModel.Contacts.Contact();
    var value = "test@fabrikam.com";
    var type = Windows.ApplicationModel.Contacts.ContactFieldType.email;
    var category = Windows.ApplicationModel.Contacts.ContactFieldCategory.work;
    var contactField = new Windows.ApplicationModel.Contacts.ContactField(value, type, category);
    contact.fields.append(contactField);
}

Remarks

Each time you create a Contact object, you get a Fields property. This property contains the data that relates to the contact. To populate a Contact object with data, you append the Fields object with one or more instances of ContactField.

At a minimum, a ContactField object must contain a string value and a ContactFieldType, which specifies whether the data is a phone number, email address, physical address, or something else. You can also add a ContactFieldCategory to differentiate between home, work, personal, or other data. You can also use a ContactField object to add custom fields to a Contact.

Constructors

ContactField(String, String, ContactFieldType, ContactFieldCategory) ContactField(String, String, ContactFieldType, ContactFieldCategory) ContactField(String, String, ContactFieldType, ContactFieldCategory) ContactField(String, String, ContactFieldType, ContactFieldCategory) ContactField(String, String, ContactFieldType, ContactFieldCategory)

Note

IContactFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactPhone or ContactEmail.

Creates a new ContactField object.

ContactField(String, ContactFieldType) ContactField(String, ContactFieldType) ContactField(String, ContactFieldType) ContactField(String, ContactFieldType) ContactField(String, ContactFieldType)

Note

IContactFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactPhone or ContactEmail.

Creates a new ContactField object.

ContactField(String, ContactFieldType, ContactFieldCategory) ContactField(String, ContactFieldType, ContactFieldCategory) ContactField(String, ContactFieldType, ContactFieldCategory) ContactField(String, ContactFieldType, ContactFieldCategory) ContactField(String, ContactFieldType, ContactFieldCategory)

Note

IContactFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactPhone or ContactEmail.

Creates a new ContactField object.

Properties

Category Category Category Category Category

Note

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

Name Name Name Name Name

Note

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

Type Type Type Type Type

Note

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

Value Value Value Value Value

Note

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