ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField Class

Definition

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

public : sealed class 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)

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)
public ContactInstantMessageField(String userName)
Public Sub New(userName As String)
var contactInstantMessageField = new contactInstantMessageField(userName);
Parameters
userName
Platform::String String String String

The user's name.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

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)
var contactInstantMessageField = new contactInstantMessageField(userName, category);
Parameters
userName
Platform::String String String String

The user's name.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
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)
var contactInstantMessageField = new contactInstantMessageField(userName, category, service, displayText, verb);
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.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
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
var contactFieldCategory = contactInstantMessageField.category;
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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
var string = contactInstantMessageField.displayText;
Value
Platform::String string string string

The display text.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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
var uri = contactInstantMessageField.launchUri;
Value
Uri Uri Uri Uri

The Uniform Resource Identifier (URI).

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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
var string = contactInstantMessageField.name;
Value
Platform::String string string string

The name of the field.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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
var string = contactInstantMessageField.service;
Value
Platform::String string string string

The service name.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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
var contactFieldType = contactInstantMessageField.type;
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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
var string = contactInstantMessageField.userName;
Value
Platform::String string string string

The user's name.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

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
var string = contactInstantMessageField.value;
Value
Platform::String string string string

The value of the contact data.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem