StoredContact StoredContact StoredContact StoredContact Class

Represents a contact associated with a custom contact store.

Syntax

Declaration

public sealed class StoredContactpublic sealed class StoredContactPublic NotInheritable Class StoredContact

Remarks

You must open your app's contact store in order to obtain a StoredContact object. To work with contact information that is not yet associated with a store or to parse contact information from a vCard, use the ContactInformation class.

These APIs create or obtain a StoredContact object:

Constructors summary

Initializes a new instance of the StoredContact class.

Initializes a new instance of the StoredContact class and initializes the property values from the provided ContactInformation object.

Properties summary

Gets or sets the display name of a stored contact.

Gets the display picture of a stored contact.

Gets or sets the date that a display picture was created or modified. Used to enable sorting of display pictures by date.

Gets or sets the family name of the stored contact.

Gets or sets the given name of the stored contact.

Gets or sets the honorific prefix of the stored contact.

Gets or sets the honorific suffix of the stored contact.

Gets the local identifier of the stored contact.

Gets the remote identifier of the stored contact.

Gets the ContactStore in which the contact is stored.

Methods summary

Gets the display picture of a stored contact.

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

Gets the known properties for the contact.

Replaces the contact with the specified ID with the current contact.

Saves the current state of the contact to the contact store.

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

  • StoredContact(Windows.Phone.PersonalInformation.ContactStore)
    StoredContact(Windows.Phone.PersonalInformation.ContactStore)
    StoredContact(Windows.Phone.PersonalInformation.ContactStore)
    StoredContact(Windows.Phone.PersonalInformation.ContactStore)

    Initializes a new instance of the StoredContact class.

    public StoredContact(Windows.Phone.PersonalInformation.ContactStore)public StoredContact(Windows.Phone.PersonalInformation.ContactStore)Public Function StoredContact(Windows.Phone.PersonalInformation.ContactStore) As

    Parameters

  • StoredContact(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation)
    StoredContact(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation)
    StoredContact(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation)
    StoredContact(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation)

    Initializes a new instance of the StoredContact class and initializes the property values from the provided ContactInformation object.

    public StoredContact(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation)public StoredContact(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation)Public Function StoredContact(Windows.Phone.PersonalInformation.ContactStore,Windows.Phone.PersonalInformation.ContactInformation) As

    Parameters

Properties

  • DisplayName
    DisplayName
    DisplayName
    DisplayName

    Gets or sets the display name of a stored 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 stored contact.

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

    Property Value

  • DisplayPictureDate
    DisplayPictureDate
    DisplayPictureDate
    DisplayPictureDate

    Gets or sets the date that a display picture was created or modified. Used to enable sorting of display pictures by date.

    public DateTime DisplayPictureDate { get; set; }public DateTime DisplayPictureDate { get; set; }Public ReadWrite Property DisplayPictureDate As DateTime

    Property Value

  • FamilyName
    FamilyName
    FamilyName
    FamilyName

    Gets or sets the family name of the stored 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 the contact.

  • GivenName
    GivenName
    GivenName
    GivenName

    Gets or sets the given name of the stored 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 the contact.

  • HonorificPrefix
    HonorificPrefix
    HonorificPrefix
    HonorificPrefix

    Gets or sets the honorific prefix of the stored 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 the contact.

  • HonorificSuffix
    HonorificSuffix
    HonorificSuffix
    HonorificSuffix

    Gets or sets the honorific suffix of the stored 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 the contact.

  • Id
    Id
    Id
    Id

    Gets the local identifier of the stored contact.

    public string Id { get; }public string Id { get; }Public ReadOnly Property Id As string

    Property Value

    • string
      string
      string
      string

      The local identifier of the contact.

    Remarks

    This identifier is assigned to the contact by the system. Your app can set a custom identifier by using the RemoteId property. Use this to associate contacts in the contact store with contacts in a remote, cloud-based contact store.

  • RemoteId
    RemoteId
    RemoteId
    RemoteId

    Gets the remote identifier of the stored contact.

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

    Property Value

    • string
      string
      string
      string

      The remote identifier of the contact.

    Remarks

    Use this property to associate the Id of the contact with the identifier used by a remote, cloud-based contact store. The value of this property must be stable and must be unique across all apps on the phone. Attempting to save a contact may fail if the RemoteId property is not unique on the phone.

  • Store
    Store
    Store
    Store

    Gets the ContactStore in which the contact is stored.

    public ContactStore Store { get; }public ContactStore Store { get; }Public ReadOnly Property Store As ContactStore

    Property Value

Methods

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

    Gets the display picture of a stored contact.

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

    Returns

  • GetExtendedPropertiesAsync()
    GetExtendedPropertiesAsync()
    GetExtendedPropertiesAsync()
    GetExtendedPropertiesAsync()

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

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

    Returns

    Remarks

    In the current release, the values stored in the collection returned by this method must be strings. The key names are app-defined and are not used by the operating system at all. To get the values for common properties, such as a contact address or telephone numbers that are used by the operating system, use GetPropertiesAsync() instead. The contents of the extended properties collection is saved when SaveAsync() is called.

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

    Gets the known properties for the contact.

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

    Returns

    Remarks

    The key names must be one of the properties of the KnownContactProperties class. To get values for arbitrary app-defined properties, use GetExtendedPropertiesAsync() instead. The contents of the collection is saved when SaveAsync() is called.

  • ReplaceExistingContactAsync(System.String)
    ReplaceExistingContactAsync(System.String)
    ReplaceExistingContactAsync(System.String)
    ReplaceExistingContactAsync(System.String)

    Replaces the contact with the specified ID with the current contact.

    public IAsyncAction ReplaceExistingContactAsync(System.String)public IAsyncAction ReplaceExistingContactAsync(System.String)Public Function ReplaceExistingContactAsync(System.String) As IAsyncAction

    Parameters

    • id
      System.String
      System.String
      System.String
      System.String

      The ID of the contact to replace.

    Returns

  • SaveAsync()
    SaveAsync()
    SaveAsync()
    SaveAsync()

    Saves the current state of the contact to the contact store.

    public IAsyncAction SaveAsync()public IAsyncAction SaveAsync()Public Function SaveAsync() As IAsyncAction

    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

  • 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

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.ContractVersionAttribute
Windows.Foundation.Metadata.ActivatableAttribute

Details

Assembly

Windows.Phone.PersonalInformation.dll