ContactList ContactList ContactList ContactList Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Represents a list of Contact objects.

public : sealed class ContactList : IContactList, IContactList2public sealed class ContactList : IContactList, IContactList2Public NotInheritable Class ContactList Implements IContactList, IContactList2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Call ContactStore.CreateContactListAsync to create a new instance of this class.

Properties

ChangeTracker ChangeTracker ChangeTracker ChangeTracker

Gets the app's ContactChangeTracker for this ContactList.

public : ContactChangeTracker ChangeTracker { get; }public ContactChangeTracker ChangeTracker { get; }Public ReadOnly Property ChangeTracker As ContactChangeTracker// You can use this property in JavaScript.

DisplayName DisplayName DisplayName DisplayName

Gets or puts the name of the ContactList, suitable for display in the user interface.

public : PlatForm::String DisplayName { get; set; }public string DisplayName { get; set; }Public ReadWrite Property DisplayName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the ContactList, suitable for display in the user interface.

Id Id Id Id

Gets the locally unique identifier for this ContactList.

public : PlatForm::String Id { get; }public string Id { get; }Public ReadOnly Property Id As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The locally unique identifier for this ContactList.

IsHidden IsHidden IsHidden IsHidden

Gets or puts a Boolean value indicating of the ContactList is hidden in the user interface.

public : PlatForm::Boolean IsHidden { get; set; }public bool IsHidden { get; set; }Public ReadWrite Property IsHidden As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

A Boolean value indicating of the ContactList is hidden in the user interface.

LimitedWriteOperations LimitedWriteOperations LimitedWriteOperations LimitedWriteOperations

Prerelease. Gets an object that provides operations that an app can perform on a contact list that it has not created.

public : ContactListLimitedWriteOperations LimitedWriteOperations { get; }public ContactListLimitedWriteOperations LimitedWriteOperations { get; }Public ReadOnly Property LimitedWriteOperations As ContactListLimitedWriteOperations// You can use this property in JavaScript.
Value
ContactListLimitedWriteOperations ContactListLimitedWriteOperations ContactListLimitedWriteOperations ContactListLimitedWriteOperations

An object that provides operations that an app can perform on a contact list that it has not created.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

OtherAppReadAccess OtherAppReadAccess OtherAppReadAccess OtherAppReadAccess

Gets or puts a value indicating the read access level to this ContactList for other apps on the system.

public : ContactListOtherAppReadAccess OtherAppReadAccess { get; set; }public ContactListOtherAppReadAccess OtherAppReadAccess { get; set; }Public ReadWrite Property OtherAppReadAccess As ContactListOtherAppReadAccess// You can use this property in JavaScript.
Value
ContactListOtherAppReadAccess ContactListOtherAppReadAccess ContactListOtherAppReadAccess ContactListOtherAppReadAccess

A value indicating the read access level to this ContactList for other apps on the system.

OtherAppWriteAccess OtherAppWriteAccess OtherAppWriteAccess OtherAppWriteAccess

Gets or puts a value indicating the write access level to this ContactList for other apps on the system.

public : ContactListOtherAppWriteAccess OtherAppWriteAccess { get; set; }public ContactListOtherAppWriteAccess OtherAppWriteAccess { get; set; }Public ReadWrite Property OtherAppWriteAccess As ContactListOtherAppWriteAccess// You can use this property in JavaScript.
Value
ContactListOtherAppWriteAccess ContactListOtherAppWriteAccess ContactListOtherAppWriteAccess ContactListOtherAppWriteAccess

A value indicating the write access level to this ContactList for other apps on the system.

SourceDisplayName SourceDisplayName SourceDisplayName SourceDisplayName

Gets the name of the source of the ContactList, suitable for display in the user interface.

public : PlatForm::String SourceDisplayName { get; }public string SourceDisplayName { get; }Public ReadOnly Property SourceDisplayName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name of the source of the ContactList, suitable for display in the user interface.

Remarks

This is usually the name of the app or service from which the contacts originate.

SupportsServerSearch SupportsServerSearch SupportsServerSearch SupportsServerSearch

Gets or sets a Boolean value indicating if you can search the remote server with this ContactList.

public : PlatForm::Boolean SupportsServerSearch { get; set; }public bool SupportsServerSearch { get; set; }Public ReadWrite Property SupportsServerSearch As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

A Boolean value indicating if you can search the remote server with this ContactList.

SyncConstraints SyncConstraints SyncConstraints SyncConstraints

Gets the ContactListSyncConstraints which indicates the maximum amount of contact list data that can be synchronized.

public : ContactListSyncConstraints SyncConstraints { get; }public ContactListSyncConstraints SyncConstraints { get; }Public ReadOnly Property SyncConstraints As ContactListSyncConstraints// You can use this property in JavaScript.
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

SyncManager SyncManager SyncManager SyncManager

Gets the ContactListSyncManager used to communicate with the server.

public : ContactListSyncManager SyncManager { get; }public ContactListSyncManager SyncManager { get; }Public ReadOnly Property SyncManager As ContactListSyncManager// You can use this property in JavaScript.

UserDataAccountId UserDataAccountId UserDataAccountId UserDataAccountId

Gets a string that represents the ID of the user data account for this ContactList.

public : PlatForm::String UserDataAccountId { get; }public string UserDataAccountId { get; }Public ReadOnly Property UserDataAccountId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A string that represents the ID of the user data account for this ContactList.

Methods

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

Asynchronously deletes this ContactList, including all Contact objects in the ContactStore.

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

An async action indicating that the method is complete.

DeleteContactAsync(Contact) DeleteContactAsync(Contact) DeleteContactAsync(Contact) DeleteContactAsync(Contact)

Asynchronously deletes and individual Contact from this ContactList and the ContactStore.

public : IAsyncAction DeleteContactAsync(Contact contact)public IAsyncAction DeleteContactAsync(Contact contact)Public Function DeleteContactAsync(contact As Contact) As IAsyncAction// You can use this method in JavaScript.
Parameters
contact
Contact Contact Contact Contact

The Contact to delete.

Returns

An async action indicating that the method is complete.

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

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

public : ContactChangeTracker GetChangeTracker(PlatForm::String identity)public ContactChangeTracker GetChangeTracker(String identity)Public Function GetChangeTracker(identity As String) As ContactChangeTracker// You can use this method in JavaScript.
Parameters
identity
PlatForm::String String String String

A string that identifies the ContactChangeTracker instance in the ContactList.

Returns

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

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.16257.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

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 ContactList, 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)

Asynchronously retrieves the specified Contact object from the ContactList.

public : IAsyncOperation<Contact> GetContactAsync(PlatForm::String contactId)public IAsyncOperation<Contact> GetContactAsync(String contactId)Public Function GetContactAsync(contactId As String) As IAsyncOperation( Of Contact )// You can use this method in JavaScript.
Parameters
contactId
PlatForm::String String String String

The string that identifies the Contact to return.

Returns

GetContactFromRemoteIdAsync(String) GetContactFromRemoteIdAsync(String) GetContactFromRemoteIdAsync(String) GetContactFromRemoteIdAsync(String)

Asynchronously gets the Contact identified by the specified RemoteId.

public : IAsyncOperation<Contact> GetContactFromRemoteIdAsync(PlatForm::String remoteId)public IAsyncOperation<Contact> GetContactFromRemoteIdAsync(String remoteId)Public Function GetContactFromRemoteIdAsync(remoteId As String) As IAsyncOperation( Of Contact )// You can use this method in JavaScript.
Parameters
remoteId
PlatForm::String String String String

An ID that can be used by a service provider to access the Contact in their remote system.

Returns

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

Gets a ContactReader object associated with this ContactList.

public : ContactReader GetContactReader()public ContactReader GetContactReader()Public Function GetContactReader() As ContactReader// You can use this method in JavaScript.
Returns
See Also

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

Gets a ContactReader object associated with this ContactList and using the specified ContactQueryOptions.

public : ContactReader GetContactReader(ContactQueryOptions options)public ContactReader GetContactReader(ContactQueryOptions options)Public Function GetContactReader(options As ContactQueryOptions) As ContactReader// You can use this method in JavaScript.
Parameters
Returns
See Also

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

Asynchronously gets the Contact object for the current user.

public : IAsyncOperation<Contact> GetMeContactAsync()public IAsyncOperation<Contact> GetMeContactAsync()Public Function GetMeContactAsync() As IAsyncOperation( Of Contact )// You can use this method in JavaScript.
Returns

RegisterSyncManagerAsync() RegisterSyncManagerAsync() RegisterSyncManagerAsync() RegisterSyncManagerAsync()

Adds a SyncManager to the ContactList.

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

An asynchronous registration operation that you can await.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

The SyncManager provides an entry point for other apps to call ContactList.SyncManager.SyncAsync. Calling ContactList.SyncManager.SyncAsync will launch the provider app as a background task and fire a IContactDataProviderConnection.SyncRequested event. An app should only call this method if they are set up as contact provider.

SaveAsync() SaveAsync() SaveAsync() SaveAsync()

Asynchronously saves this ContactList.

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

An async action indicating that the method has completed.

SaveContactAsync(Contact) SaveContactAsync(Contact) SaveContactAsync(Contact) SaveContactAsync(Contact)

Asynchronously saves the specified Contact to the ContactStore.

public : IAsyncAction SaveContactAsync(Contact contact)public IAsyncAction SaveContactAsync(Contact contact)Public Function SaveContactAsync(contact As Contact) As IAsyncAction// You can use this method in JavaScript.
Parameters
contact
Contact Contact Contact Contact

The contact to save.

Returns

An async action indicating that the method has completed.

Remarks

Throws a System.ArgumentException: 'Value does not fall within the expected range.' when the contact passed as parameter has a RemoteID set which is identical to a contacts RemoteID already saved on this device.

Events

ContactChanged ContactChanged ContactChanged ContactChanged

Occurs when a Contact in this ContactList has been changed.

public : event TypedEventHandler ContactChanged<ContactList,  ContactChangedEventArgs>public event TypedEventHandler ContactChanged<ContactList,  ContactChangedEventArgs>Public Event ContactChanged<ContactList,  ContactChangedEventArgs>// You can use this event in JavaScript.