Contact​Store Contact​Store Contact​Store Class

Definition

Represents the custom contact store for a Windows Phone app.

public sealed class ContactStore : IContactStore, IContactStore2public sealed class ContactStore : IContactStore, IContactStore2Public NotInheritable Class ContactStore Implements IContactStore, IContactStore2
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]

Properties

RevisionNumber RevisionNumber RevisionNumber

Gets the revision number for the contact store.

public ulong RevisionNumber { get; }public ulong RevisionNumber { get; }Public ReadOnly Property RevisionNumber As ulong
Value
ulong ulong ulong

The revision number for the contact store.

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

CreateContactQuery() CreateContactQuery() CreateContactQuery()

Creates a contact query with the default options.

public ContactQueryResult CreateContactQuery()public ContactQueryResult CreateContactQuery()Public Function CreateContactQuery() As ContactQueryResult
Returns
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]

CreateContactQuery(ContactQueryOptions) CreateContactQuery(ContactQueryOptions) CreateContactQuery(ContactQueryOptions)

Creates a contact query with the custom options.

public ContactQueryResult CreateContactQuery(ContactQueryOptions options)public ContactQueryResult CreateContactQuery(ContactQueryOptions options)Public Function CreateContactQuery(options As ContactQueryOptions) As ContactQueryResult
Parameters
Returns
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]

CreateMeContactAsync(String) CreateMeContactAsync(String) CreateMeContactAsync(String)

Establishes that the specified contact represents the current signed-in user of the device.

public IAsyncOperation<StoredContact> CreateMeContactAsync(String id)public IAsyncOperation<StoredContact> CreateMeContactAsync(String id)Public Function CreateMeContactAsync(id As String) As IAsyncOperation( Of StoredContact )
Parameters
id
System.String System.String System.String

The ID of the contact that represents the current signed-in user of the device.

Returns

An asynchronous operation that returns a StoredContact on successful completion. If you use Asynchronous programming, the result type is StoredContact.

Attributes
See Also

CreateOrOpenAsync() CreateOrOpenAsync() CreateOrOpenAsync()

Opens the app's custom contact store, creating the store with the default options if it does not already exist.

public static IAsyncOperation<ContactStore> CreateOrOpenAsync()public static IAsyncOperation<ContactStore> CreateOrOpenAsync()Public Static Function CreateOrOpenAsync() As IAsyncOperation( Of ContactStore )
Returns

When this method completes, it returns a ContactStore object representing the app's custom contact store. If you use Asynchronous programming, the result type is ContactStore.

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

When this method is used to create the custom contact store, the default values of ReadOnly for ContactStoreSystemAccessMode and LimitedReadOnly for ContactStoreApplicationAccessMode are used.

CreateOrOpenAsync(ContactStoreSystemAccessMode, ContactStoreApplicationAccessMode) CreateOrOpenAsync(ContactStoreSystemAccessMode, ContactStoreApplicationAccessMode) CreateOrOpenAsync(ContactStoreSystemAccessMode, ContactStoreApplicationAccessMode)

Opens the app's custom contact store, creating the store with the specified options if it does not already exist.

public static IAsyncOperation<ContactStore> CreateOrOpenAsync(ContactStoreSystemAccessMode access, ContactStoreApplicationAccessMode sharing)public static IAsyncOperation<ContactStore> CreateOrOpenAsync(ContactStoreSystemAccessMode access, ContactStoreApplicationAccessMode sharing)Public Static Function CreateOrOpenAsync(access As ContactStoreSystemAccessMode, sharing As ContactStoreApplicationAccessMode) As IAsyncOperation( Of ContactStore )
Parameters
access
ContactStoreSystemAccessMode ContactStoreSystemAccessMode ContactStoreSystemAccessMode

Whether contacts in the store can be modified by the phone experience or only by the app that created it.

sharing
ContactStoreApplicationAccessMode ContactStoreApplicationAccessMode ContactStoreApplicationAccessMode

Whether all properties for contacts in the store are visible to other applications or just the description and display picture.

Returns

When this method completes, it returns a ContactStore object representing the app's custom contact store. If you use Asynchronous programming, the result type is ContactStore.

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

DeleteAsync() DeleteAsync() DeleteAsync()

Deletes the app's custom contact store.

public IAsyncAction DeleteAsync()public IAsyncAction DeleteAsync()Public Function DeleteAsync() 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

DeleteContactAsync(String) DeleteContactAsync(String) DeleteContactAsync(String)

Deletes the contact with the specified ID from the contact store.

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

The ID of the contact to be deleted.

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

FindContactByIdAsync(String) FindContactByIdAsync(String) FindContactByIdAsync(String)

Retrieves the contact with the specified ID from the contact store.

public IAsyncOperation<StoredContact> FindContactByIdAsync(String id)public IAsyncOperation<StoredContact> FindContactByIdAsync(String id)Public Function FindContactByIdAsync(id As String) As IAsyncOperation( Of StoredContact )
Parameters
id
System.String System.String System.String

The ID of the contact to retrieve.

Returns

When this method completes, it returns a StoredContact object. If you use Asynchronous programming, the result type is StoredContact.

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

FindContactByRemoteIdAsync(String) FindContactByRemoteIdAsync(String) FindContactByRemoteIdAsync(String)

Retrieves the contact with the specified remote ID from the contact store.

public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(String id)public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(String id)Public Function FindContactByRemoteIdAsync(id As String) As IAsyncOperation( Of StoredContact )
Parameters
id
System.String System.String System.String

The application-defined remote ID of the contact to retrieve.

Returns

When this method completes, it returns a StoredContact object. If you use Asynchronous programming, the result type is StoredContact.

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

GetChangesAsync(UInt64) GetChangesAsync(UInt64) GetChangesAsync(UInt64)

Gets the list of changes to the contact store associated with the provided revision number.

public IAsyncOperation<IVectorView<ContactChangeRecord>> GetChangesAsync(UInt64 baseRevisionNumber)public IAsyncOperation<IVectorView<ContactChangeRecord>> GetChangesAsync(UInt64 baseRevisionNumber)Public Function GetChangesAsync(baseRevisionNumber As UInt64) As IAsyncOperation( Of IVectorViewContactChangeRecord )
Parameters
baseRevisionNumber
System.UInt64 System.UInt64 System.UInt64

The revision number for which changes should be retrieved.

Returns

When this method completes, it returns a VectorView containing a ContactChangeRecord object for each change associated with the revision number. If you use Asynchronous programming, the result type is a read-only list/vector of ContactChangeRecord items. (You can use APIs of IVectorView; for C++, APIs of IReadOnlyList<ContactChangeRecord> 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]
See Also

LoadExtendedPropertiesAsync() LoadExtendedPropertiesAsync() LoadExtendedPropertiesAsync()

Loads the extended properties for the app's custom contact store.

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

When this method completes, it returns an map/dictionary containing string key/untyped value pairs. 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

This method is used to access the extended properties for the contact store, not for individual contacts. A common scenario is to use the contact store's extended properties to store revision numbers for the local contact store and a remote contact store in and then using GetChangesAsync to synchronize the two stores. To access extended properties to individual contacts, see GetExtendedPropertiesAsync.

See Also

SaveExtendedPropertiesAsync(IMapView<String, Object>) SaveExtendedPropertiesAsync(IMapView<String, Object>) SaveExtendedPropertiesAsync(IMapView<String, Object>)

Saves the provided list of name/value pairs to the custom contact store's extended properties.

public IAsyncAction SaveExtendedPropertiesAsync(IMapView<String, Object> data)public IAsyncAction SaveExtendedPropertiesAsync(IMapView<String, Object> data)Public Function SaveExtendedPropertiesAsync(data As IMapView<String, Object>) As IAsyncAction
Parameters
data

The set of name/value properties to set.

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

See Also