Stored​Contact Stored​Contact Stored​Contact Class

Definition

Represents a contact associated with a custom contact store.

public sealed class StoredContact : IContactInformation, IContactInformation2, IStoredContactpublic sealed class StoredContact : IContactInformation, IContactInformation2, IStoredContactPublic NotInheritable Class StoredContact Implements IContactInformation, IContactInformation2, IStoredContact
Attributes
Windows 10 requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

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

StoredContact(ContactStore) StoredContact(ContactStore) StoredContact(ContactStore)

Initializes a new instance of the StoredContact class.

public StoredContact(ContactStore store)public StoredContact(ContactStore store)Public Sub New(store As ContactStore)
Parameters
store
ContactStore ContactStore ContactStore

The contact store in which the contact should be created.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

StoredContact(ContactStore, ContactInformation) StoredContact(ContactStore, ContactInformation) StoredContact(ContactStore, ContactInformation)

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

public StoredContact(ContactStore store, ContactInformation contact)public StoredContact(ContactStore store, ContactInformation contact)Public Sub New(store As ContactStore, contact As ContactInformation)
Parameters
store
ContactStore ContactStore ContactStore

The contact store in which the contact should be created.

contact
ContactInformation ContactInformation ContactInformation

The contact information object with which the new contact object properties will be initialized.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

Properties

DisplayName DisplayName DisplayName

Gets or sets the display name of a stored contact.

public PlatForm::String DisplayName { get; set; }public string DisplayName { get; set; }Public ReadWrite Property DisplayName As string
Value
string string string

The display name of a contact.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

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
Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

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 DateTimeOffset DisplayPictureDate { get; set; }Public ReadWrite Property DisplayPictureDate As DateTimeOffset
Value
DateTime DateTime DateTime

The date that a display picture was created or modified.

Attributes

FamilyName FamilyName FamilyName

Gets or sets the family name of the stored contact.

public PlatForm::String FamilyName { get; set; }public string FamilyName { get; set; }Public ReadWrite Property FamilyName As string
Value
string string string

The family name of the contact.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

GivenName GivenName GivenName

Gets or sets the given name of the stored contact.

public PlatForm::String GivenName { get; set; }public string GivenName { get; set; }Public ReadWrite Property GivenName As string
Value
string string string

The given name of the contact.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

HonorificPrefix HonorificPrefix HonorificPrefix

Gets or sets the honorific prefix of the stored contact.

public PlatForm::String HonorificPrefix { get; set; }public string HonorificPrefix { get; set; }Public ReadWrite Property HonorificPrefix As string
Value
string string string

The honorific prefix of the contact.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

HonorificSuffix HonorificSuffix HonorificSuffix

Gets or sets the honorific suffix of the stored contact.

public PlatForm::String HonorificSuffix { get; set; }public string HonorificSuffix { get; set; }Public ReadWrite Property HonorificSuffix As string
Value
string string string

The honorific suffix of the contact.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

Id Id Id

Gets the local identifier of the stored contact.

public PlatForm::String Id { get; }public string Id { get; }Public ReadOnly Property Id As string
Value
string string string

The local identifier of the contact.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

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

Gets the remote identifier of the stored contact.

public PlatForm::String RemoteId { get; set; }public string RemoteId { get; set; }Public ReadWrite Property RemoteId As string
Value
string string string

The remote identifier of the contact.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

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.

See Also

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
Value
ContactStore ContactStore ContactStore

The ContactStore in which the contact is stored.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

Methods

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

An asynchronous operation that returns an IRandomAccessStream object on successful completion. If you use Asynchronous programming, the result type is IRandomAccessStream. This is the image source file as a bitmap stream.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]
See Also

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

When this method completes, it returns a map/dictionary of name/value pairs (string name, untyped values). If you use Asynchronous programming, the result type is a map or dictionary of these key-value pairs, keyed by string names. (You can use APIs of IMap<Platform::String,Platform::Object> for C++, APIs of IDictionary<String,Object> for .NET.)

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

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.

See Also

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

When this method completes, it returns a map/dictionary of name/value pairs (string name, untyped values). If you use Asynchronous programming, the result type is a map or dictionary of these key-value pairs, keyed by string names. (You can use APIs of IMap<Platform::String,Platform::Object> for C++, APIs of IDictionary<String,Object> for .NET.)

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]

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.

See Also

ReplaceExistingContactAsync(String) ReplaceExistingContactAsync(String) ReplaceExistingContactAsync(String)

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

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

The ID of the contact to replace.

Returns

An asynchronous action. If you use Asynchronous programming, the result type is void.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]
See Also

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

An asynchronous action. If you use Asynchronous programming, the result type is void.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]
See Also

SetDisplayPictureAsync(IInputStream) SetDisplayPictureAsync(IInputStream) SetDisplayPictureAsync(IInputStream)

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

public IAsyncAction SetDisplayPictureAsync(IInputStream stream)public IAsyncAction SetDisplayPictureAsync(IInputStream stream)Public Function SetDisplayPictureAsync(stream As IInputStream) As IAsyncAction
Parameters
stream
IInputStream IInputStream IInputStream

The stream containing the image data.

Returns

An asynchronous action. If you use Asynchronous programming, the result type is void.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]
See Also

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

When this method completes, it returns a stream containing the vCard data. If you use Asynchronous programming, the result type is IRandomAccessStream, which is the data.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]
See Also

ToVcardAsync(VCardFormat) ToVcardAsync(VCardFormat) ToVcardAsync(VCardFormat)

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

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

The format that the returned vCard will use.

Returns

When this method completes, it returns a stream containing the vCard data. If you use Asynchronous programming, the result type is IRandomAccessStream, which is the data.

Attributes
Additional features and requirements
Device family
Windows Mobile Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Phone.PhoneContract (introduced v1)
Capabilities
ID_CAP_CONTACTS [Windows Phone]
See Also

See Also