Contact​Instant​Message​Field 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// You can use this class in JavaScript.
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)

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.

public : ContactInstantMessageField(PlatForm::String userName, ContactFieldCategory category)public ContactInstantMessageField(String userName, ContactFieldCategory category)Public Sub New(userName As String, category As ContactFieldCategory)// You can use this method in JavaScript.
Parameters
userName
PlatForm::String String String String

The user's name.

See Also

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.

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)// You can use this method in JavaScript.
Parameters
userName
PlatForm::String String String String

The user's name.

service
PlatForm::String String String String

The name of the instant messaging service.

displayText
PlatForm::String String String String

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

verb
Uri Uri Uri Uri

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

See Also

Properties

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.

public : ContactFieldCategory Category { get; }public ContactFieldCategory Category { get; }Public ReadOnly Property Category As ContactFieldCategory// You can use this property in JavaScript.

Remarks

See the ContactFieldCategory class for more info on the available values for this property.

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.

public : PlatForm::String DisplayText { get; }public string DisplayText { get; }Public ReadOnly Property DisplayText As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The display text.

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.

public : Uri LaunchUri { get; }public Uri LaunchUri { get; }Public ReadOnly Property LaunchUri As Uri// You can use this property in JavaScript.
Value
Uri Uri Uri Uri

The Uniform Resource Identifier (URI).

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.

public : PlatForm::String Name { get; }public string Name { get; }Public ReadOnly Property Name As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the field.

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.

public : PlatForm::String Service { get; }public string Service { get; }Public ReadOnly Property Service As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The service name.

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.

public : ContactFieldType Type { get; }public ContactFieldType Type { get; }Public ReadOnly Property Type As ContactFieldType// You can use this property in JavaScript.

Remarks

See the ContactFieldType class for more info on the available values for this property.

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.

public : PlatForm::String UserName { get; }public string UserName { get; }Public ReadOnly Property UserName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The user's name.

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 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// You can use this property in JavaScript.
Value
PlatForm::String string string string

The value of the contact data.