ContactStore ContactStore ContactStore ContactStore Class

Definition

Represents a database that contains contacts.

public : sealed class ContactStore : IContactStore, IContactStore2
public sealed class ContactStore : IContactStore, IContactStore2
Public NotInheritable Class ContactStore Implements IContactStore, IContactStore2
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

Remarks

To get a ContactStore object, call the static utility method ContactManager.RequestStoreAsync.

Properties

AggregateContactManager AggregateContactManager AggregateContactManager AggregateContactManager

Gets a contact manager that provides functionality for linking individual (raw) contacts across services together into a single aggregate contact.

public : AggregateContactManager AggregateContactManager { get; }
public AggregateContactManager AggregateContactManager { get; }
Public ReadOnly Property AggregateContactManager As AggregateContactManager
var aggregateContactManager = contactStore.aggregateContactManager;
Value
AggregateContactManager AggregateContactManager AggregateContactManager AggregateContactManager

A contact manager that provides functionality for linking individual (raw) contacts across services together into a single aggregate contact.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

ChangeTracker ChangeTracker ChangeTracker ChangeTracker

Gets the ContactChangeTracker which provides functionality for monitoring changes to Contact objects in the ContactStore.

public : ContactChangeTracker ChangeTracker { get; }
public ContactChangeTracker ChangeTracker { get; }
Public ReadOnly Property ChangeTracker As ContactChangeTracker
var contactChangeTracker = contactStore.changeTracker;
Value
ContactChangeTracker ContactChangeTracker ContactChangeTracker ContactChangeTracker

The ContactChangeTracker which provides functionality for monitoring changes to Contact objects in the ContactStore.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

Methods

CreateContactListAsync(String) CreateContactListAsync(String) CreateContactListAsync(String) CreateContactListAsync(String)

Asynchronously creates a ContactList with the specified display name.

public : IAsyncOperation<ContactList> CreateContactListAsync(Platform::String displayName)
public IAsyncOperation<ContactList> CreateContactListAsync(String displayName)
Public Function CreateContactListAsync(displayName As String) As IAsyncOperation( Of ContactList )
Windows.ApplicationModel.Contacts.ContactStore.createContactListAsync(displayName).done( /* Your success and error handlers */ );
Parameters
displayName
Platform::String String String String

A name for the new ContactList, suitable for displaying in the user interface.

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

CreateContactListAsync(String, String) CreateContactListAsync(String, String) CreateContactListAsync(String, String) CreateContactListAsync(String, String)

Asynchronously creates a ContactList with the specified display name and user account.

public : IAsyncOperation<ContactList> CreateContactListAsync(Platform::String displayName, Platform::String userDataAccountId)
public IAsyncOperation<ContactList> CreateContactListAsync(String displayName, String userDataAccountId)
Public Function CreateContactListAsync(displayName As String, userDataAccountId As String) As IAsyncOperation( Of ContactList )
Windows.ApplicationModel.Contacts.ContactStore.createContactListAsync(displayName, userDataAccountId).done( /* Your success and error handlers */ );
Parameters
displayName
Platform::String String String String

A name for the new ContactList, suitable for displaying in the user interface.

userDataAccountId
Platform::String String String String

The ID for the UserDataAccount to use when creating the ContactList.

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

FindContactListsAsync() FindContactListsAsync() FindContactListsAsync() FindContactListsAsync()

Asynchronously returns the list of ContactList objects.

public : IAsyncOperation<IVectorView<ContactList>> FindContactListsAsync()
public IAsyncOperation<IReadOnlyList<ContactList>> FindContactListsAsync()
Public Function FindContactListsAsync() As IAsyncOperation<IReadOnlyList<ContactList>>( Of IVectorView )
Windows.ApplicationModel.Contacts.ContactStore.findContactListsAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IVectorView<ContactList>> IAsyncOperation<IReadOnlyList<ContactList>> IAsyncOperation<IReadOnlyList<ContactList>> IAsyncOperation<IReadOnlyList<ContactList>>

The list of ContactList objects.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

FindContactsAsync() FindContactsAsync() FindContactsAsync() FindContactsAsync()

Retrieves the list of all contacts in the contact store.

public : IAsyncOperation<IVectorView<Contact>> FindContactsAsync()
public IAsyncOperation<IReadOnlyList<Contact>> FindContactsAsync()
Public Function FindContactsAsync() As IAsyncOperation<IReadOnlyList<Contact>>( Of IVectorView )
Windows.ApplicationModel.Contacts.ContactStore.findContactsAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IVectorView<Contact>> IAsyncOperation<IReadOnlyList<Contact>> IAsyncOperation<IReadOnlyList<Contact>> IAsyncOperation<IReadOnlyList<Contact>>

An asynchronous operation that returns a list of all Contact objects in the contact store. If you use Asynchronous programming, the result type is a read-only list/vector of Contact items. (You can use APIs of IVectorView; for C++ or JavaScript, APIs of IReadOnlyList for .NET.)

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

FindContactsAsync(String) FindContactsAsync(String) FindContactsAsync(String) FindContactsAsync(String)

Retrieves a list of Contact objects based on the supplied search text.

public : IAsyncOperation<IVectorView<Contact>> FindContactsAsync(Platform::String searchText)
public IAsyncOperation<IReadOnlyList<Contact>> FindContactsAsync(String searchText)
Public Function FindContactsAsync(searchText As String) As IAsyncOperation<IReadOnlyList<Contact>>( Of IVectorView )
Windows.ApplicationModel.Contacts.ContactStore.findContactsAsync(searchText).done( /* Your success and error handlers */ );
Parameters
searchText
Platform::String String String String

The search string for the operation. The query will attempt to match the name (Name ), email address (Emails values), or phone number (Phones values) of a contact.

Returns
IAsyncOperation<IVectorView<Contact>> IAsyncOperation<IReadOnlyList<Contact>> IAsyncOperation<IReadOnlyList<Contact>> IAsyncOperation<IReadOnlyList<Contact>>

An asynchronous operation that returns a search-filtered list of contacts on successful completion. If you use Asynchronous programming, the result type is a read-only list/vector of Contact items. (You can use APIs of IVectorView; for C++ or JavaScript, APIs of IReadOnlyList for .NET.)

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

GetChangeTracker(String) GetChangeTracker(String) GetChangeTracker(String) GetChangeTracker(String)

Gets a ContactChangeTracker that provides functionality for monitoring changes to Contact objects in the ContactStore.

public : ContactChangeTracker GetChangeTracker(Platform::String identity)
public ContactChangeTracker GetChangeTracker(String identity)
Public Function GetChangeTracker(identity As String) As ContactChangeTracker
var contactChangeTracker = contactStore.getChangeTracker(identity);
Parameters
identity
Platform::String String String String

A string that identifies the ContactChangeTracker instance in the store.

Returns

A ContactChangeTracker that provides functionality for monitoring changes to Contact objects in the ContactStore.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)
Capabilities
contactsSystem

Remarks

You can create multiple ContactChangeTracker instances by using this method. If you pass in a string that identifies a ContactChangeTracker that already exists in the store, this method returns that instance. If the string that you pass into this method does not identify an existing an existing ContactChangeTracker, this method returns a new ContactChangeTracker.

You can use the IsTracking property of the ContactChangeTracker to determine whether change tracking is enabled for the ContactChangeTracker.

GetContactAsync(String) GetContactAsync(String) GetContactAsync(String) GetContactAsync(String)

Retrieves a Contact object representing the contact with the specified Id value.

public : IAsyncOperation<Contact> GetContactAsync(Platform::String contactId)
public IAsyncOperation<Contact> GetContactAsync(String contactId)
Public Function GetContactAsync(contactId As String) As IAsyncOperation( Of Contact )
Windows.ApplicationModel.Contacts.ContactStore.getContactAsync(contactId).done( /* Your success and error handlers */ );
Parameters
contactId
Platform::String String String String

The Id of the contact to be retrieved.

Returns

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

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

GetContactListAsync(String) GetContactListAsync(String) GetContactListAsync(String) GetContactListAsync(String)

Asynchronously gets the ContactList with the specified ID.

public : IAsyncOperation<ContactList> GetContactListAsync(Platform::String contactListId)
public IAsyncOperation<ContactList> GetContactListAsync(String contactListId)
Public Function GetContactListAsync(contactListId As String) As IAsyncOperation( Of ContactList )
Windows.ApplicationModel.Contacts.ContactStore.getContactListAsync(contactListId).done( /* Your success and error handlers */ );
Parameters
contactListId
Platform::String String String String

The ID of the ContactList to retrieve.

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

Remarks

This method throws an invalid argument exception if the contactListId is malformed.

GetContactReader() GetContactReader() GetContactReader() GetContactReader()

Creates and returns a ContactReader for the ContactStore.

public : ContactReader GetContactReader()
public ContactReader GetContactReader()
Public Function GetContactReader() As ContactReader
var contactReader = contactStore.getContactReader();
Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

GetContactReader(ContactQueryOptions) GetContactReader(ContactQueryOptions) GetContactReader(ContactQueryOptions) GetContactReader(ContactQueryOptions)

Creates and returns a ContactReader for the ContactStore with the specified ContactQueryOptions.

public : ContactReader GetContactReader(ContactQueryOptions options)
public ContactReader GetContactReader(ContactQueryOptions options)
Public Function GetContactReader(options As ContactQueryOptions) As ContactReader
var contactReader = contactStore.getContactReader(options);
Parameters
options
ContactQueryOptions ContactQueryOptions ContactQueryOptions ContactQueryOptions

The query options to use when creating the new ContactReader.

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem
See Also

GetMeContactAsync() GetMeContactAsync() GetMeContactAsync() GetMeContactAsync()

Get the Contact object for the current user.

public : IAsyncOperation<Contact> GetMeContactAsync()
public IAsyncOperation<Contact> GetMeContactAsync()
Public Function GetMeContactAsync() As IAsyncOperation( Of Contact )
Windows.ApplicationModel.Contacts.ContactStore.getMeContactAsync().done( /* Your success and error handlers */ );
Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem

Events

ContactChanged ContactChanged ContactChanged ContactChanged

Occurs when a Contact in the ContactStore has been changed.

public : event TypedEventHandler ContactChanged<ContactStore, ContactChangedEventArgs>
public event TypedEventHandler ContactChanged<ContactStore, ContactChangedEventArgs>
Public Event TypedEventHandler ContactChanged( Of ( Of ContactStore ), ( Of ContactChangedEventArgs ))
function onContactChanged(eventArgs){/* Your code */}


contactStore.addEventListener("contactChanged", onContactChanged);
contactStore.removeEventListener("contactChanged", onContactChanged);
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
contactsSystem