ContactManager
ContactManager
ContactManager
ContactManager
Class
Definition
Represents a service that source apps can call to access contact data.
public : static class ContactManagerpublic static class ContactManagerPublic Static Class ContactManager// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
All relevant methods of this class are static methods.
For info about how to manage contacts, see Managing contact cards and Managing contact cards .
Properties
IncludeMiddleNameInSystemDisplayAndSort IncludeMiddleNameInSystemDisplayAndSort IncludeMiddleNameInSystemDisplayAndSort IncludeMiddleNameInSystemDisplayAndSort
Gets or sets a Boolean that indicates whether the middle name of a contact is included in the DisplayName and SortName of a contact.
public : static PlatForm::Boolean IncludeMiddleNameInSystemDisplayAndSort { get; set; }public static bool IncludeMiddleNameInSystemDisplayAndSort { get; set; }Public Static ReadWrite Property IncludeMiddleNameInSystemDisplayAndSort As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
A Boolean that indicates whether the middle name of a contact is included in the DisplayName and SortName of a contact.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
SystemDisplayNameOrder SystemDisplayNameOrder SystemDisplayNameOrder SystemDisplayNameOrder
Gets or puts the display name order.
public : static ContactNameOrder SystemDisplayNameOrder { get; set; }public static ContactNameOrder SystemDisplayNameOrder { get; set; }Public Static ReadWrite Property SystemDisplayNameOrder As ContactNameOrder// You can use this property in JavaScript.
Specifies the display name order.
SystemSortOrder SystemSortOrder SystemSortOrder SystemSortOrder
Gets or puts the sort order.
public : static ContactNameOrder SystemSortOrder { get; set; }public static ContactNameOrder SystemSortOrder { get; set; }Public Static ReadWrite Property SystemSortOrder As ContactNameOrder// You can use this property in JavaScript.
Specifies the sort order.
Methods
ConvertContactToVCardAsync(Contact) ConvertContactToVCardAsync(Contact) ConvertContactToVCardAsync(Contact) ConvertContactToVCardAsync(Contact)
Asynchronously converts a Contact to a vCard.
public : static IAsyncOperation<RandomAccessStreamReference> ConvertContactToVCardAsync(Contact contact)public static IAsyncOperation<RandomAccessStreamReference> ConvertContactToVCardAsync(Contact contact)Public Static Function ConvertContactToVCardAsync(contact As Contact) As IAsyncOperation( Of RandomAccessStreamReference )// You can use this method in JavaScript.
A stream containing the vCard data.
- See Also
ConvertContactToVCardAsync(Contact, UInt32) ConvertContactToVCardAsync(Contact, UInt32) ConvertContactToVCardAsync(Contact, UInt32) ConvertContactToVCardAsync(Contact, UInt32)
Asynchronously converts a Contact to a vCard.
public : static IAsyncOperation<RandomAccessStreamReference> ConvertContactToVCardAsync(Contact contact, unsigned int maxBytes)public static IAsyncOperation<RandomAccessStreamReference> ConvertContactToVCardAsync(Contact contact, UInt32 maxBytes)Public Static Function ConvertContactToVCardAsync(contact As Contact, maxBytes As UInt32) As IAsyncOperation( Of RandomAccessStreamReference )// You can use this method in JavaScript.
- maxBytes
- unsigned int UInt32 UInt32 UInt32
The maximum size for the vCard in bytes.
A stream containing the vCard data.
- See Also
ConvertVCardToContactAsync(IRandomAccessStreamReference) ConvertVCardToContactAsync(IRandomAccessStreamReference) ConvertVCardToContactAsync(IRandomAccessStreamReference) ConvertVCardToContactAsync(IRandomAccessStreamReference)
Asynchronously converts a vCard to a Contact.
public : static IAsyncOperation<Contact> ConvertVCardToContactAsync(IRandomAccessStreamReference vCard)public static IAsyncOperation<Contact> ConvertVCardToContactAsync(IRandomAccessStreamReference vCard)Public Static Function ConvertVCardToContactAsync(vCard As IRandomAccessStreamReference) As IAsyncOperation( Of Contact )// You can use this method in JavaScript.
- vCard
- IRandomAccessStreamReference IRandomAccessStreamReference IRandomAccessStreamReference IRandomAccessStreamReference
A stream containing the vCard data.
GetForUser(User) GetForUser(User) GetForUser(User) GetForUser(User)
Gets the ContactManagerForUser object for the specified user.
public : static ContactManagerForUser GetForUser(User user)public static ContactManagerForUser GetForUser(User user)Public Static Function GetForUser(user As User) As ContactManagerForUser// You can use this method in JavaScript.
The user account to use to get the ContactManagerForUser object.
Returns the contact manager for the account specified by the user parameter.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
IsShowContactCardSupported() IsShowContactCardSupported() IsShowContactCardSupported() IsShowContactCardSupported()
Gets a Boolean value indicating if the ShowContactCard method is supported on the current platform.
public : static PlatForm::Boolean IsShowContactCardSupported()public static bool IsShowContactCardSupported()Public Static Function IsShowContactCardSupported() As bool// You can use this method in JavaScript.
A Boolean value indicating if the ShowContactCard method is supported on the current platform.
Remarks
Note
Source apps must be running in the foreground to call this method. An app that runs in the background will get an "Access Denied" exception if it calls this method. The return value of the method should not be cached and should only be called when needed.
IsShowDelayLoadedContactCardSupported() IsShowDelayLoadedContactCardSupported() IsShowDelayLoadedContactCardSupported() IsShowDelayLoadedContactCardSupported()
Gets a Boolean value indicating if the ShowDelayLoadedContactCard method is supported on the current platform.
public : static PlatForm::Boolean IsShowDelayLoadedContactCardSupported()public static bool IsShowDelayLoadedContactCardSupported()Public Static Function IsShowDelayLoadedContactCardSupported() As bool// You can use this method in JavaScript.
A Boolean value indicating if the ShowDelayLoadedContactCard method is supported on the current platform.
Remarks
Note
Source apps must be running in the foreground to call this method. An app that runs in the background will get an "Access Denied" exception if it calls this method. The return value of the method should not be cached and should only be called when needed.
IsShowFullContactCardSupportedAsync() IsShowFullContactCardSupportedAsync() IsShowFullContactCardSupportedAsync() IsShowFullContactCardSupportedAsync()
Gets a Boolean value indicating if the ShowFullContactCard method is supported on the current platform.
public : static IAsyncOperation<PlatForm::Boolean> IsShowFullContactCardSupportedAsync()public static IAsyncOperation<bool> IsShowFullContactCardSupportedAsync()Public Static Function IsShowFullContactCardSupportedAsync() As IAsyncOperation( Of bool )// You can use this method in JavaScript.
An asynchronous operation that returns true if the ShowFullContactCard method is supported on the current platform.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType) RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType) RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType) RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType)
Asynchronously requests access to the ContactAnnotationStore.
public : static IAsyncOperation<ContactAnnotationStore> RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType accessType)public static IAsyncOperation<ContactAnnotationStore> RequestAnnotationStoreAsync(ContactAnnotationStoreAccessType accessType)Public Static Function RequestAnnotationStoreAsync(accessType As ContactAnnotationStoreAccessType) As IAsyncOperation( Of ContactAnnotationStore )// You can use this method in JavaScript.
- accessType
- ContactAnnotationStoreAccessType ContactAnnotationStoreAccessType ContactAnnotationStoreAccessType ContactAnnotationStoreAccessType
Specifies the type of access request, app contact annotations or all annotations.
RequestStoreAsync() RequestStoreAsync() RequestStoreAsync() RequestStoreAsync()
Retrieves a ContactStore object that enables searching or retrieving contacts on the device.
public : static IAsyncOperation<ContactStore> RequestStoreAsync()public static IAsyncOperation<ContactStore> RequestStoreAsync()Public Static Function RequestStoreAsync() As IAsyncOperation( Of ContactStore )// You can use this method in JavaScript.
An asynchronous operation that returns a ContactStore object on successful completion.
Remarks
This method requests AllContactsReadOnly access to the contact store. If you require a different level of access, call the RequestStoreAsync(ContactStoreAccessType) method instead.
- See Also
RequestStoreAsync(ContactStoreAccessType) RequestStoreAsync(ContactStoreAccessType) RequestStoreAsync(ContactStoreAccessType) RequestStoreAsync(ContactStoreAccessType)
Retrieves a ContactStore object that enables searching or retrieving contacts on the device.
public : static IAsyncOperation<ContactStore> RequestStoreAsync(ContactStoreAccessType accessType)public static IAsyncOperation<ContactStore> RequestStoreAsync(ContactStoreAccessType accessType)Public Static Function RequestStoreAsync(accessType As ContactStoreAccessType) As IAsyncOperation( Of ContactStore )// You can use this method in JavaScript.
- accessType
- ContactStoreAccessType ContactStoreAccessType ContactStoreAccessType ContactStoreAccessType
Specifies the type of read/write access requested.
An asynchronous operation that returns a ContactStore object on successful completion.
- See Also
ShowContactCard(Contact, Rect) ShowContactCard(Contact, Rect) ShowContactCard(Contact, Rect) ShowContactCard(Contact, Rect)
Queries the operating system for a user’s contact and shows the contact data in a contact card.
public : static void ShowContactCard(Contact contact, Rect selection)public static void ShowContactCard(Contact contact, Rect selection)Public Static Function ShowContactCard(contact As Contact, selection As Rect) As void// You can use this method in JavaScript.
The object that represents the contact that the app wants to display the contact card for.contact must contain at least an Id, Emails, or a phone number from a Phones list to query the user’s contact database to retrieve a matching contact to display. Id has higher priority for querying. If an Id matches, the rest of query parameters will be ignored for matching purposes. If an Id does not find a match, the query uses the rest of query parameters. Emails and Phones have equal priority for matching. If multiple email addresses, or phone numbers, or both are provided, the query first performs an exact match, requiring all query parameters to match a system contact record. If this results in no matches, the query uses "best effort" match, in which a match of any query parameters is sufficient.
If no matches occur, the data in the input contact displays in the contact card. If a match occurs, only system contact data displays, and the data in the input contact is discarded.
The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the contact card, not within that rectangular area. For example, if an app uses a button to show the contact card, pass the Rect of the button so the contact card displays around the button, not overlapping it.
Remarks
Note
Source apps must be running in the foreground to call this method. An app that runs in the background will get an "Access Denied" exception if it calls this method.
Most typical operations will result in displaying a UI.
- If there is one exact match for the requested contact: Shows the contact card UI with information from the contacts store in the operating system.
- If there are multiple matches: Shows the contact card UI for the first matching contact found.
- If there is no match: Shows the contact card UI, where the contact info comes from the input contact object.
If there's an error, such as an invalid input for the contact parameter, no UI is displayed.
For querying purposes, phone numbers support characters 0-9 and a-z/A-Z. If you put any other characters in a phone number, they are ignored when you query the contact.
For info about how to manage contacts, see Managing contact cards and Managing contact cards .
For querying purposes, phone numbers support characters 0-9 and a-z/A-Z. If you put any other characters in a phone number, they are ignored when you query the contact.
- See Also
ShowContactCard(Contact, Rect, Placement) ShowContactCard(Contact, Rect, Placement) ShowContactCard(Contact, Rect, Placement) ShowContactCard(Contact, Rect, Placement)
Queries the operating system for a user’s contact and shows the contact data in a contact card.
public : static void ShowContactCard(Contact contact, Rect selection, Placement preferredPlacement)public static void ShowContactCard(Contact contact, Rect selection, Placement preferredPlacement)Public Static Function ShowContactCard(contact As Contact, selection As Rect, preferredPlacement As Placement) As void// You can use this method in JavaScript.
The object that represents the contact that the app wants to display the contact card for.contact must contain at least an Id, Emails, or a phone number from a Phones list to query the user’s contact database to retrieve a matching contact to display. Id has higher priority for querying. If an Id matches, the rest of query parameters will be ignored for matching purposes. If an Id does not find a match, the query uses the rest of query parameters. Emails and Phones have equal priority for matching. If multiple email addresses, or phone numbers, or both are provided, the query first performs an exact match, requiring all query parameters to match a system contact record. If this results in no matches, the query uses "best effort" match, in which a match of any query parameters is sufficient.
If no matches occur, the data in the input contact displays in the contact card. If a match occurs, only system contact data displays, and the data in the input contact is discarded.
The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the contact card, not within that rectangular area. For example, if an app uses a button to show the contact card, pass the Rect of the button so the contact card displays around the button, not overlapping it.
The Placement that describes the preferred placement of the contact card.
Remarks
See the remarks section of this overload: ShowContactCard.
- See Also
ShowContactCard(Contact, Rect, Placement, ContactCardOptions) ShowContactCard(Contact, Rect, Placement, ContactCardOptions) ShowContactCard(Contact, Rect, Placement, ContactCardOptions) ShowContactCard(Contact, Rect, Placement, ContactCardOptions)
Shows a contact card with the specified parameters.
public : static void ShowContactCard(Contact contact, Rect selection, Placement preferredPlacement, ContactCardOptions contactCardOptions)public static void ShowContactCard(Contact contact, Rect selection, Placement preferredPlacement, ContactCardOptions contactCardOptions)Public Static Function ShowContactCard(contact As Contact, selection As Rect, preferredPlacement As Placement, contactCardOptions As ContactCardOptions) As void// You can use this method in JavaScript.
The object that represents the contact that the app wants to display the contact card for.contact must contain at least an Id, Emails, or a phone number from a Phones list to query the user’s contact database to retrieve a matching contact to display. Id has higher priority for querying. If an Id matches, the rest of query parameters will be ignored for matching purposes. If an Id does not find a match, the query uses the rest of query parameters. Emails and Phones have equal priority for matching. If multiple email addresses, or phone numbers, or both are provided, the query first performs an exact match, requiring all query parameters to match a system contact record. If this results in no matches, the query uses "best effort" match, in which a match of any query parameters is sufficient.
If no matches occur, the data in the input contact displays in the contact card. If a match occurs, only system contact data displays, and the data in the input contact is discarded.
The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the contact card, not within that rectangular area. For example, if an app uses a button to show the contact card, pass the Rect of the button so the contact card displays around the button, not overlapping it.
The Placement that describes the preferred placement of the contact card.
- contactCardOptions
- ContactCardOptions ContactCardOptions ContactCardOptions ContactCardOptions
Specifies how to display the contact card, such as which tab to start on when displaying a mini contact card.
Remarks
See the remarks section of this overload: ShowContactCard.
- See Also
ShowDelayLoadedContactCard(Contact, Rect, Placement) ShowDelayLoadedContactCard(Contact, Rect, Placement) ShowDelayLoadedContactCard(Contact, Rect, Placement) ShowDelayLoadedContactCard(Contact, Rect, Placement)
Shows a contact card that can be updated later if the contact does not exist in the user’s contact database.
public : static ContactCardDelayedDataLoader ShowDelayLoadedContactCard(Contact contact, Rect selection, Placement preferredPlacement)public static ContactCardDelayedDataLoader ShowDelayLoadedContactCard(Contact contact, Rect selection, Placement preferredPlacement)Public Static Function ShowDelayLoadedContactCard(contact As Contact, selection As Rect, preferredPlacement As Placement) As ContactCardDelayedDataLoader// You can use this method in JavaScript.
The object that represents the contact that the app wants to display the contact card for.contact must contain at least an Id, Emails, or a phone number from a Phones list to query the user’s contact database to retrieve a matching contact to display. Id has higher priority for querying. If an Id matches, the rest of query parameters will be ignored for matching purposes. If an Id does not find a match, the query uses the rest of query parameters. Emails and Phones have equal priority for matching. If multiple email addresses, or phone numbers, or both are provided, the query first performs an exact match, requiring all query parameters to match a system contact record. If this results in no matches, the query uses "best effort" match, in which a match of any query parameters is sufficient.
If no matches occur, the data in the input contact displays in the contact card. If a match occurs, only system contact data displays, and the data in the input contact is discarded.
The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the contact card, not within that rectangular area. For example, if an app uses a button to show the contact card, pass the Rect of the button so the contact card displays around the button, not overlapping it.
The Placement that describes the preferred placement of the contact card.
Returns the ContactCardDelayedDataLoader object that can be used to update the contact card.
- See Also
ShowDelayLoadedContactCard(Contact, Rect, Placement, ContactCardOptions) ShowDelayLoadedContactCard(Contact, Rect, Placement, ContactCardOptions) ShowDelayLoadedContactCard(Contact, Rect, Placement, ContactCardOptions) ShowDelayLoadedContactCard(Contact, Rect, Placement, ContactCardOptions)
Shows a contact card that can be updated later if the contact does not exist in the user’s contact database.
public : static ContactCardDelayedDataLoader ShowDelayLoadedContactCard(Contact contact, Rect selection, Placement preferredPlacement, ContactCardOptions contactCardOptions)public static ContactCardDelayedDataLoader ShowDelayLoadedContactCard(Contact contact, Rect selection, Placement preferredPlacement, ContactCardOptions contactCardOptions)Public Static Function ShowDelayLoadedContactCard(contact As Contact, selection As Rect, preferredPlacement As Placement, contactCardOptions As ContactCardOptions) As ContactCardDelayedDataLoader// You can use this method in JavaScript.
The object that represents the contact that the app wants to display the contact card for.contact must contain at least an Id, Emails, or a phone number from a Phones list to query the user’s contact database to retrieve a matching contact to display. Id has higher priority for querying. If an Id matches, the rest of query parameters will be ignored for matching purposes. If an Id does not find a match, the query uses the rest of query parameters. Emails and Phones have equal priority for matching. If multiple email addresses, or phone numbers, or both are provided, the query first performs an exact match, requiring all query parameters to match a system contact record. If this results in no matches, the query uses "best effort" match, in which a match of any query parameters is sufficient.
If no matches occur, the data in the input contact displays in the contact card. If a match occurs, only system contact data displays, and the data in the input contact is discarded.
The Rect is the rectangular area of user selection (for example, pressing a button), around which the operating system displays the contact card, not within that rectangular area. For example, if an app uses a button to show the contact card, pass the Rect of the button so the contact card displays around the button, not overlapping it.
The Placement that describes the preferred placement of the contact card.
- contactCardOptions
- ContactCardOptions ContactCardOptions ContactCardOptions ContactCardOptions
Specifies how to display the contact card, such as which tab to start on if you are displaying a mini contact card, or what header type to use if you are showing a full contact card.
Returns the ContactCardDelayedDataLoader object that can be used to update the contact card.
- See Also
ShowFullContactCard(Contact, FullContactCardOptions) ShowFullContactCard(Contact, FullContactCardOptions) ShowFullContactCard(Contact, FullContactCardOptions) ShowFullContactCard(Contact, FullContactCardOptions)
Queries the operating system for a user’s contact and shows the contact data in a full contact card.
public : static void ShowFullContactCard(Contact contact, FullContactCardOptions fullContactCardOptions)public static void ShowFullContactCard(Contact contact, FullContactCardOptions fullContactCardOptions)Public Static Function ShowFullContactCard(contact As Contact, fullContactCardOptions As FullContactCardOptions) As void// You can use this method in JavaScript.
The object that represents the contact that the app wants to display the contact card for.contact must contain at least an Id, Emails, or a phone number from a Phones list to query the user’s contact database to retrieve a matching contact to display. Id has higher priority for querying. If an Id matches, the rest of query parameters will be ignored for matching purposes. If an Id does not find a match, the query uses the rest of query parameters. Emails and Phones have equal priority for matching. If multiple email addresses, or phone numbers, or both are provided, the query first performs an exact match, requiring all query parameters to match a system contact record. If this results in no matches, the query uses "best effort" match, in which a match of any query parameters is sufficient.
If no matches occur, the data in the input contact displays in the contact card. If a match occurs, only system contact data displays, and the data in the input contact is discarded.
- fullContactCardOptions
- FullContactCardOptions FullContactCardOptions FullContactCardOptions FullContactCardOptions
Specifies how to display the full contact card.
- See Also