ContactInformation ContactInformation ContactInformation ContactInformation Class

Represents a contact without an association to a contact store.

Syntax

Declaration

public sealed class ContactInformationpublic sealed class ContactInformationPublic NotInheritable Class ContactInformation

Remarks

This class is used to store information about a contact. It has a set of commonly used built-in properties like a family name and a description, and it also allows you to store custom properties as name/value pairs. The StoredContact class shares all of these properties but it requires you to open your app's custom contact store before you can obtain an instance of the class. Many applications will use StoredContact directly and never need to use ContactInformation. If you need to temporarily store contact information without opening your contact store or if you need to parse contact information from a vCard using ParseVcardAsync(Windows.Storage.Streams.IInputStream), you can use ContactInformation and then pass the object to the @Windows.Phone.PersonalInformation.StoredContact.#ctor(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation) constructor.

Constructors summary

Initializes a new instance of the ContactInformation class.

Properties summary

Gets or sets the display name of a contact.

Gets the display picture of a contact.

Gets or sets the family name of a contact.

Gets or sets the given name of a contact.

Gets or sets the honorific prefix of a contact.

Gets or sets the honorific suffix of a contact.

Methods summary

Gets the display picture of a contact.

Gets the properties for a contact as an map of name/value pairs.

Parses a vCard from a stream and returns a populated ContactInformation object.

Sets the display picture for a contact using an IInputStream object.

Retrieves a vCard representation of the contact using the vCard version 3.0 format.

Retrieves a vCard representation of the contact using the specified vCard format.

Constructors

  • ContactInformation()
    ContactInformation()
    ContactInformation()
    ContactInformation()

    Initializes a new instance of the ContactInformation class.

    public ContactInformation()public ContactInformation()Public Function ContactInformation() As

Properties

  • DisplayName
    DisplayName
    DisplayName
    DisplayName

    Gets or sets the display name of a contact.

    public string DisplayName { get; set; }public string DisplayName { get; set; }Public ReadWrite Property DisplayName As string

    Property Value

    • string
      string
      string
      string

      The display name of a contact.

  • DisplayPicture
    DisplayPicture
    DisplayPicture
    DisplayPicture

    Gets the display picture of a contact.

    public IRandomAccessStreamReference DisplayPicture { get; }public IRandomAccessStreamReference DisplayPicture { get; }Public ReadOnly Property DisplayPicture As IRandomAccessStreamReference

    Property Value

    Remarks

    To set this value, use SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream).

  • FamilyName
    FamilyName
    FamilyName
    FamilyName

    Gets or sets the family name of a contact.

    public string FamilyName { get; set; }public string FamilyName { get; set; }Public ReadWrite Property FamilyName As string

    Property Value

    • string
      string
      string
      string

      The family name of a contact.

  • GivenName
    GivenName
    GivenName
    GivenName

    Gets or sets the given name of a contact.

    public string GivenName { get; set; }public string GivenName { get; set; }Public ReadWrite Property GivenName As string

    Property Value

    • string
      string
      string
      string

      The given name of a contact.

  • HonorificPrefix
    HonorificPrefix
    HonorificPrefix
    HonorificPrefix

    Gets or sets the honorific prefix of a contact.

    public string HonorificPrefix { get; set; }public string HonorificPrefix { get; set; }Public ReadWrite Property HonorificPrefix As string

    Property Value

    • string
      string
      string
      string

      The honorific prefix of a contact.

  • HonorificSuffix
    HonorificSuffix
    HonorificSuffix
    HonorificSuffix

    Gets or sets the honorific suffix of a contact.

    public string HonorificSuffix { get; set; }public string HonorificSuffix { get; set; }Public ReadWrite Property HonorificSuffix As string

    Property Value

    • string
      string
      string
      string

      The honorific suffix of a contact.

Methods

  • GetDisplayPictureAsync()
    GetDisplayPictureAsync()
    GetDisplayPictureAsync()
    GetDisplayPictureAsync()

    Gets the display picture of a contact.

    public IAsyncOperation<IRandomAccessStream> GetDisplayPictureAsync()public IAsyncOperation<IRandomAccessStream> GetDisplayPictureAsync()Public Function GetDisplayPictureAsync() As IAsyncOperation( Of IRandomAccessStream )

    Returns

    • A stream containing the image data.

  • GetPropertiesAsync()
    GetPropertiesAsync()
    GetPropertiesAsync()
    GetPropertiesAsync()

    Gets the properties for a contact as an map of name/value pairs.

    public IAsyncOperation<IMap<string, object>> GetPropertiesAsync()public IAsyncOperation<IMap<string, object>> GetPropertiesAsync()Public Function GetPropertiesAsync() As IAsyncOperation( Of IMapstring, object )

    Returns

    Remarks

    When working with the collection that this method returns, use the KnownContactProperties static properties as the key value. This assures that you're asking for known, existing properties.

  • ParseVcardAsync(Windows.Storage.Streams.IInputStream)
    ParseVcardAsync(Windows.Storage.Streams.IInputStream)
    ParseVcardAsync(Windows.Storage.Streams.IInputStream)
    ParseVcardAsync(Windows.Storage.Streams.IInputStream)

    Parses a vCard from a stream and returns a populated ContactInformation object.

    public static IAsyncOperation<ContactInformation> ParseVcardAsync(Windows.Storage.Streams.IInputStream)public static IAsyncOperation<ContactInformation> ParseVcardAsync(Windows.Storage.Streams.IInputStream)Public Static Function ParseVcardAsync(Windows.Storage.Streams.IInputStream) As IAsyncOperation( Of ContactInformation )

    Parameters

    Returns

  • SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream)
    SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream)
    SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream)
    SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream)

    Sets the display picture for a contact using an IInputStream object.

    public IAsyncAction SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream)public IAsyncAction SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream)Public Function SetDisplayPictureAsync(Windows.Storage.Streams.IInputStream) As IAsyncAction

    Parameters

    Returns

  • ToVcardAsync()
    ToVcardAsync()
    ToVcardAsync()
    ToVcardAsync()

    Retrieves a vCard representation of the contact using the vCard version 3.0 format.

    public IAsyncOperation<IRandomAccessStream> ToVcardAsync()public IAsyncOperation<IRandomAccessStream> ToVcardAsync()Public Function ToVcardAsync() As IAsyncOperation( Of IRandomAccessStream )

    Returns

    Remarks

    vCard is a file format standard for electronic business cards.

  • ToVcardAsync(Windows.Phone.PersonalInformation.VCardFormat)
    ToVcardAsync(Windows.Phone.PersonalInformation.VCardFormat)
    ToVcardAsync(Windows.Phone.PersonalInformation.VCardFormat)
    ToVcardAsync(Windows.Phone.PersonalInformation.VCardFormat)

    Retrieves a vCard representation of the contact using the specified vCard format.

    public IAsyncOperation<IRandomAccessStream> ToVcardAsync(Windows.Phone.PersonalInformation.VCardFormat)public IAsyncOperation<IRandomAccessStream> ToVcardAsync(Windows.Phone.PersonalInformation.VCardFormat)Public Function ToVcardAsync(Windows.Phone.PersonalInformation.VCardFormat) As IAsyncOperation( Of IRandomAccessStream )

    Parameters

    Returns

    Remarks

    vCard is a file format standard for electronic business cards.

Device family

Windows Mobile Extension SDK (introduced v10.0.10240.0)

API contract

Windows.Phone.PhoneContract (introduced v1)

Capabilities

ID_CAP_CONTACTS [Windows Phone]

Attributes

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

Details

Assembly

Windows.Phone.PersonalInformation.dll