Contact​Instant​Message​Field Contact​Instant​Message​Field Contact​Instant​Message​Field Class

Definition

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

public : sealed class ContactInstantMessageField : IContactField, IContactInstantMessageFieldpublic sealed class ContactInstantMessageField : IContactField, IContactInstantMessageFieldPublic NotInheritable Class ContactInstantMessageField Implements IContactField, IContactInstantMessageField
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

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

public : ContactInstantMessageField(PlatForm::String userName, ContactFieldCategory category)public ContactInstantMessageField(String userName, ContactFieldCategory category)Public Sub New(userName As String, category As ContactFieldCategory)
Parameters
userName
PlatForm::String String String

The user's name.

category
ContactFieldCategory ContactFieldCategory ContactFieldCategory

The category of contact data.

Attributes
See Also

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.

public : ContactInstantMessageField(PlatForm::String userName, ContactFieldCategory category, PlatForm::String service, PlatForm::String displayText, Uri verb)public ContactInstantMessageField(String userName, ContactFieldCategory category, String service, String displayText, Uri verb)Public Sub New(userName As String, category As ContactFieldCategory, service As String, displayText As String, verb As Uri)
Parameters
userName
PlatForm::String String String

The user's name.

category
ContactFieldCategory ContactFieldCategory ContactFieldCategory

The category of the contact data.

service
PlatForm::String String String

The name of the instant messaging service.

displayText
PlatForm::String String String

The display text used with the instant messaging Uniform Resource Identifier (URI).

verb
Uri Uri Uri

The Uniform Resource Identifier (URI) that starts an instant message.

Attributes
See Also

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.

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.

public : PlatForm::String DisplayText { get; }public string DisplayText { get; }Public ReadOnly Property DisplayText As string
Value
PlatForm::String string string

The display text.

Attributes

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.

public : Uri LaunchUri { get; }public Uri LaunchUri { get; }Public ReadOnly Property LaunchUri As Uri
Value
Uri Uri Uri

The Uniform Resource Identifier (URI).

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 : PlatForm::String Name { get; }public string Name { get; }Public ReadOnly Property Name As string
Value
PlatForm::String string string

The name of the field.

Attributes

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.

public : PlatForm::String Service { get; }public string Service { get; }Public ReadOnly Property Service As string
Value
PlatForm::String string string

The service name.

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.

UserName UserName UserName

Note

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

Gets the user's name.

public : PlatForm::String UserName { get; }public string UserName { get; }Public ReadOnly Property UserName As string
Value
PlatForm::String string string

The user's name.

Attributes

Remarks

Remember that the user's name for an instant message account is not always the same as his or her actual name. If you want a user's actual name, use the ContactInformation.name 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 : PlatForm::String Value { get; }public string Value { get; }Public ReadOnly Property Value As string
Value
PlatForm::String string string

The value of the contact data.

Attributes