ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField Class

Definition

Defines a field that is an instant messaging (IM) address.

public : sealed class ContactInstantMessageField : IContactField, IContactInstantMessageField
struct winrt::Windows::ApplicationModel::Contacts::ContactInstantMessageField : IContactField, IContactInstantMessageField
public sealed class ContactInstantMessageField : IContactField, IContactInstantMessageField
Public NotInheritable Class ContactInstantMessageField Implements IContactField, IContactInstantMessageField
var contactInstantMessageField = new contactInstantMessageField(userName);
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 demonstrates the use of the ContactInstantMessageField object.

function getInstantMessageInfo() {
    var picker = Windows.ApplicationModel.Contacts.ContactPicker();
    picker.commitButtonText = "Select";
    picker.selectionMode = Windows.ApplicationModel.Contacts.ContactSelectionMode.fields;
    picker.desiredFields.append(Windows.ApplicationModel.Contacts.KnownContactField.instantMessage);
    picker.pickSingleContactAsync().then(function (contact) {
        var contactElement = document.createElement("div");
        var contactData = contact.name + "<br/>";
        contactData += contact.instantMessages[0].displayText + "<br/>";
        contactData += contact.instantMessages[0].launchUri + "<br/>";
        contactData += contact.instantMessages[0].service + "<br/>";
        contactData += contact.instantMessages[0].userName + "<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 ContactInstantMessageField objects when a contact provider returns the requested contact information. You can access these objects through the ContactInformation.InstantMessages property.

Constructors

ContactInstantMessageField(String) ContactInstantMessageField(String) ContactInstantMessageField(String) ContactInstantMessageField(String) ContactInstantMessageField(String)

Note

IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Creates a new ContactInstantMessageField object.

ContactInstantMessageField(String, ContactFieldCategory) ContactInstantMessageField(String, ContactFieldCategory) ContactInstantMessageField(String, ContactFieldCategory) ContactInstantMessageField(String, ContactFieldCategory) ContactInstantMessageField(String, ContactFieldCategory)

Note

IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Creates a new ContactInstantMessageField object.

ContactInstantMessageField(String, ContactFieldCategory, String, String, Uri) ContactInstantMessageField(String, ContactFieldCategory, String, String, Uri) ContactInstantMessageField(String, ContactFieldCategory, String, String, Uri) ContactInstantMessageField(String, ContactFieldCategory, String, String, Uri) ContactInstantMessageField(String, ContactFieldCategory, String, String, Uri)

Note

IContactInstantMessageFieldFactory may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Creates a new ContactInstantMessageField 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.

DisplayText DisplayText DisplayText DisplayText DisplayText

Note

ContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Gets the display text for the Uniform Resource Identifier (URI)that starts an instant message.

LaunchUri LaunchUri LaunchUri LaunchUri LaunchUri

Note

ContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Gets the Uniform Resource Identifier (URI)that can start an instant message.

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.

Service Service Service Service Service

Note

ContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Gets the name of the service used for sending instant messages.

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.

UserName UserName UserName UserName UserName

Note

ContactInstantMessageField may be altered or unavailable for releases after Windows 8.1. Instead, use ContactConnectedServiceAccount.

Gets the user's name.

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.