ContactStore ContactStore ContactStore ContactStore Class

Definition

Represents the custom contact store for a Windows Phone app.

public sealed class ContactStorepublic sealed class ContactStorePublic NotInheritable Class ContactStorepublic sealed class ContactStore
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 RevisionNumber

Gets the revision number for the contact store.

public ulong RevisionNumber { get; }public ulong RevisionNumber { get; }Public ReadOnly Property RevisionNumber As ulongpublic ulong RevisionNumber { get; }
Value
ulong 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() CreateContactQuery()

Creates a contact query with the default options.

public ContactQueryResult CreateContactQuery()public ContactQueryResult CreateContactQuery()Public Function CreateContactQuery() As ContactQueryResultpublic ContactQueryResult CreateContactQuery()
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) 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 ContactQueryResultpublic ContactQueryResult CreateContactQuery(ContactQueryOptions options)
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) 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 )public IAsyncOperation<StoredContact> CreateMeContactAsync(String id)
Parameters
id
System.String 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

CreateOrOpenAsync() 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 )public static IAsyncOperation<ContactStore> CreateOrOpenAsync()
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) 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 )public static IAsyncOperation<ContactStore> CreateOrOpenAsync(ContactStoreSystemAccessMode access, ContactStoreApplicationAccessMode sharing)
Parameters
access
ContactStoreSystemAccessMode 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 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]

DeleteAsync() DeleteAsync() DeleteAsync() DeleteAsync()

Deletes the app's custom contact store.

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

DeleteContactAsync(String) 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 IAsyncActionpublic IAsyncAction DeleteContactAsync(String id)
Parameters
id
System.String 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]

FindContactByIdAsync(String) 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 )public IAsyncOperation<StoredContact> FindContactByIdAsync(String id)
Parameters
id
System.String 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]

FindContactByRemoteIdAsync(String) 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 )public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(String id)
Parameters
id
System.String 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]

GetChangesAsync(UInt64) 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 )public IAsyncOperation<IVectorView<ContactChangeRecord>> GetChangesAsync(UInt64 baseRevisionNumber)
Parameters
baseRevisionNumber
System.UInt64 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]

LoadExtendedPropertiesAsync() 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 )public IAsyncOperation<IMap<string, object>> LoadExtendedPropertiesAsync()
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.

SaveExtendedPropertiesAsync(IMapView<String, Object>) 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 IAsyncActionpublic IAsyncAction SaveExtendedPropertiesAsync(IMapView<String, Object> data)
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]