Contact​Store 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// You can use this class in JavaScript.
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 ulong// You can use this property in JavaScript.
Value
ulong ulong ulong ulong

The revision number for the contact store.

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 ContactQueryResult// You can use this method in JavaScript.
Returns
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

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 ContactQueryResult// You can use this method in JavaScript.
Parameters
Returns
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

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(PlatForm::String id)public IAsyncOperation<StoredContact> CreateMeContactAsync(String id)Public Function CreateMeContactAsync(id As String) As IAsyncOperation( Of StoredContact )// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

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

Returns
See Also

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 )// You can use this method in JavaScript.
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.

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.

See Also

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 )// You can use this method in JavaScript.
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.

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() DeleteAsync()

Deletes the app's custom contact store.

public : IAsyncAction DeleteAsync()public IAsyncAction DeleteAsync()Public Function DeleteAsync() As IAsyncAction// You can use this method in JavaScript.
Returns

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

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) DeleteContactAsync(String)

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

public : IAsyncAction DeleteContactAsync(PlatForm::String id)public IAsyncAction DeleteContactAsync(String id)Public Function DeleteContactAsync(id As String) As IAsyncAction// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

The ID of the contact to be deleted.

Returns

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

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) FindContactByIdAsync(String)

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

public : IAsyncOperation<StoredContact> FindContactByIdAsync(PlatForm::String id)public IAsyncOperation<StoredContact> FindContactByIdAsync(String id)Public Function FindContactByIdAsync(id As String) As IAsyncOperation( Of StoredContact )// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

The ID of the contact to retrieve.

Returns
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) FindContactByRemoteIdAsync(String)

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

public : IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(PlatForm::String id)public IAsyncOperation<StoredContact> FindContactByRemoteIdAsync(String id)Public Function FindContactByRemoteIdAsync(id As String) As IAsyncOperation( Of StoredContact )// You can use this method in JavaScript.
Parameters
id
PlatForm::String String String String

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

Returns
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) GetChangesAsync(UInt64)

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

public : IAsyncOperation<IVectorView<ContactChangeRecord>> GetChangesAsync(unsigned __int64 baseRevisionNumber)public IAsyncOperation<IReadOnlyList<ContactChangeRecord>> GetChangesAsync(UInt64 baseRevisionNumber)Public Function GetChangesAsync(baseRevisionNumber As UInt64) As IAsyncOperation( Of IReadOnlyListContactChangeRecord )// You can use this method in JavaScript.
Parameters
baseRevisionNumber
unsigned __int64 UInt64 UInt64 UInt64

The revision number for which changes should be retrieved.

Returns
IAsyncOperation<IVectorView<ContactChangeRecord>> IAsyncOperation<IReadOnlyList<ContactChangeRecord>> IAsyncOperation<IReadOnlyList<ContactChangeRecord>> IAsyncOperation<IReadOnlyList<ContactChangeRecord>>

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.)

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() LoadExtendedPropertiesAsync()

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

public : IAsyncOperation<IMap<PlatForm::String, PlatForm::Object>> LoadExtendedPropertiesAsync()public IAsyncOperation<IDictionary<string, object>> LoadExtendedPropertiesAsync()Public Function LoadExtendedPropertiesAsync() As IAsyncOperation( Of IDictionarystring, object )// You can use this method in JavaScript.
Returns
IAsyncOperation<IMap<PlatForm::String, PlatForm::Object>> IAsyncOperation<IDictionary<string, object>> IAsyncOperation<IDictionary<string, object>> IAsyncOperation<IDictionary<string, object>>

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.)

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>) SaveExtendedPropertiesAsync(IMapView<String, Object>)

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

public : IAsyncAction SaveExtendedPropertiesAsync(IMapView<PlatForm::String, PlatForm::Object> data)public IAsyncAction SaveExtendedPropertiesAsync(IReadOnlyDictionary<String, Object> data)Public Function SaveExtendedPropertiesAsync(data As IReadOnlyDictionary<String, Object>) As IAsyncAction// You can use this method in JavaScript.
Parameters
data
IMapView<PlatForm::String, PlatForm::Object> IReadOnlyDictionary<String, Object> IReadOnlyDictionary<String, Object> IReadOnlyDictionary<String, Object>

The set of name/value properties to set.

Returns

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

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