ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField ContactInstantMessageField Class

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

Syntax

Declaration

public sealed class ContactInstantMessageFieldpublic sealed class ContactInstantMessageFieldPublic NotInheritable Class ContactInstantMessageFieldpublic sealed class ContactInstantMessageField

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 InstantMessages property.

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);
    });
}

Constructors summary

Note

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

Creates a new ContactInstantMessageField object.

Note

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

Creates a new ContactInstantMessageField object.

Note

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

Creates a new ContactInstantMessageField object.

Properties summary

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.

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.

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.

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.

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.

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.

Note

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

Gets the user's 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 value of the contact data.

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(String userName)public New(String userName)Public Sub New(userName As String)public ContactInstantMessageField(String userName)

    Parameters

    • userName
      System.String
      System.String
      System.String
      System.String

      The user's name.

  • 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(String userName, ContactFieldCategory category)public New(String userName, ContactFieldCategory category)Public Sub New(userName As String, category As ContactFieldCategory)public ContactInstantMessageField(String userName, ContactFieldCategory category)

    Parameters

  • 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(String userName, ContactFieldCategory category, String service, String displayText, Uri verb)public New(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)public ContactInstantMessageField(String userName, ContactFieldCategory category, String service, String displayText, Uri verb)

    Parameters

    • userName
      System.String
      System.String
      System.String
      System.String

      The user's name.

    • category

      The category of the contact data.

    • service
      System.String
      System.String
      System.String
      System.String

      The name of the instant messaging service.

    • displayText
      System.String
      System.String
      System.String
      System.String

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

    • verb

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

Properties

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.ApplicationModel.Contacts.dll