UserDataAccount UserDataAccount UserDataAccount UserDataAccount Class

Definition

Represents a user data account used to access email, contacts, calendars, and so on.

public : sealed class UserDataAccount : IUserDataAccount, IUserDataAccount2, IUserDataAccount3, IUserDataAccount4
public sealed class UserDataAccount : IUserDataAccount, IUserDataAccount2, IUserDataAccount3, IUserDataAccount4
Public NotInheritable Class UserDataAccount Implements IUserDataAccount, IUserDataAccount2, IUserDataAccount3, IUserDataAccount4
// 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)

Remarks

Call UserDataAccountStore.GetAccountAsync to get an instance of this class.

Properties

CanShowCreateContactGroup CanShowCreateContactGroup CanShowCreateContactGroup CanShowCreateContactGroup

This API supports the product infrastructure and is not intended to be used directly from your code.

Microsoft Internal Use Only.

public : Platform::Boolean CanShowCreateContactGroup { get; set; }
public bool CanShowCreateContactGroup { get; set; }
Public ReadWrite Property CanShowCreateContactGroup As bool
var bool = userDataAccount.canShowCreateContactGroup;
userDataAccount.canShowCreateContactGroup = bool;
Value
Platform::Boolean bool bool bool

A ContactGroup.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

DeviceAccountTypeId DeviceAccountTypeId DeviceAccountTypeId DeviceAccountTypeId

Gets the unique identifier for the type of the account.

public : Platform::String DeviceAccountTypeId { get; }
public string DeviceAccountTypeId { get; }
Public ReadOnly Property DeviceAccountTypeId As string
var string = userDataAccount.deviceAccountTypeId;
Value
Platform::String string string string

The unique identifier for the type of the account such as Exchange, Google, Pop/IMAP and so on.

Remarks

Valid values for this property are:

Account typeID
Exchange Active Sync6833942B-ABDA-4C20-9757-4F9252396BD4
Google via Exchange Active SyncE288529A-1917-4985-897F-34D8121EBFC3
Internet Mail (Pop/IMAP)DC23EAD7-BBF2-44D7-A791-6B2B7580F0C2
Google via IMAP/CardDAV/CalDAV0A95CDAA-C7EB-4133-9793-75E13089F082
iCloud via IMAP/CardDAV/CalDAV45157403-77C9-4E68-9485-6DD9A79D534A

Other values may be added in the future, so you should have a default case to handle unknown values.

DisplayName DisplayName DisplayName DisplayName

Gets or sets the human readable display name for the user data account.

public : Platform::String DisplayName { get; set; }
public string DisplayName { get; set; }
Public ReadWrite Property DisplayName As string
var string = userDataAccount.displayName;
userDataAccount.displayName = string;
Value
Platform::String string string string

The human readable display name for the user data account.

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

EnterpriseId EnterpriseId EnterpriseId EnterpriseId

Gets the enterprise identity associated with the user account.

public : Platform::String EnterpriseId { get; }
public string EnterpriseId { get; }
Public ReadOnly Property EnterpriseId As string
var string = userDataAccount.enterpriseId;
Value
Platform::String string string string

The enterprise identity associated with the user account.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

The EnterpriseId is often a corporate email address and is used when encrypting or decrypting corporate data.

Important

If the EnterpriseId is null or empty then the account is not enterprise protected.

ExplictReadAccessPackageFamilyNames ExplictReadAccessPackageFamilyNames ExplictReadAccessPackageFamilyNames ExplictReadAccessPackageFamilyNames

Gets a list of package family names for apps that have explicit read access even if they don't have the system capability.

public : IVector<Platform::String> ExplictReadAccessPackageFamilyNames { get; }
public IList<string> ExplictReadAccessPackageFamilyNames { get; }
Public ReadOnly Property ExplictReadAccessPackageFamilyNames As IList<string>
var iList = userDataAccount.explictReadAccessPackageFamilyNames;
Value
IVector<Platform::String> IList<string> IList<string> IList<string>

A list of package family names for apps that have explicit read access even if they don't have the system capability.

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

Icon Icon Icon Icon

Gets the icon associated with the UserDataAccount.

public : IRandomAccessStreamReference Icon { get; set; }
public IRandomAccessStreamReference Icon { get; set; }
Public ReadWrite Property Icon As IRandomAccessStreamReference
var iRandomAccessStreamReference = userDataAccount.icon;
userDataAccount.icon = iRandomAccessStreamReference;

Remarks

This property is only valid for device user data accounts. It will return null for app user data accounts.

Id Id Id Id

Gets a string that uniquely identifies the UserDataAccount on the local device.

public : Platform::String Id { get; }
public string Id { get; }
Public ReadOnly Property Id As string
var string = userDataAccount.id;
Value
Platform::String string string string

A string that uniquely identifies the UserDataAccount on the local device.

IsProtectedUnderLock IsProtectedUnderLock IsProtectedUnderLock IsProtectedUnderLock

Gets a Boolean value indicating if the user account data is encrypted when the device becomes locked.

public : Platform::Boolean IsProtectedUnderLock { get; set; }
public bool IsProtectedUnderLock { get; set; }
Public ReadWrite Property IsProtectedUnderLock As bool
var bool = userDataAccount.isProtectedUnderLock;
userDataAccount.isProtectedUnderLock = bool;
Value
Platform::Boolean bool bool bool

A Boolean value indicating if the user account data is encrypted when the device becomes locked.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

Encrypted data will return as empty value sets during a locked state.

OtherAppReadAccess OtherAppReadAccess OtherAppReadAccess OtherAppReadAccess

Gets or sets a value indicating whether other apps on the device have read access to the UserDataAccount.

public : UserDataAccountOtherAppReadAccess OtherAppReadAccess { get; set; }
public UserDataAccountOtherAppReadAccess OtherAppReadAccess { get; set; }
Public ReadWrite Property OtherAppReadAccess As UserDataAccountOtherAppReadAccess
var userDataAccountOtherAppReadAccess = userDataAccount.otherAppReadAccess;
userDataAccount.otherAppReadAccess = userDataAccountOtherAppReadAccess;

PackageFamilyName PackageFamilyName PackageFamilyName PackageFamilyName

Gets the unique identifier for the app package that created the UserDataAccount.

public : Platform::String PackageFamilyName { get; }
public string PackageFamilyName { get; }
Public ReadOnly Property PackageFamilyName As string
var string = userDataAccount.packageFamilyName;
Value
Platform::String string string string

The unique identifier for the app package that created the UserDataAccount.

Remarks

This value will be null for device user data accounts.

ProviderProperties ProviderProperties ProviderProperties ProviderProperties

Provides a place to store data to be used by the app when interacting with a UserDataAccount provider.

public : IPropertySet ProviderProperties { get; }
public IPropertySet ProviderProperties { get; }
Public ReadOnly Property ProviderProperties As IPropertySet
var iPropertySet = userDataAccount.providerProperties;
Value
IPropertySet IPropertySet IPropertySet IPropertySet

Data to be used by the app when interacting with a UserDataAccount provider.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

UserDisplayName UserDisplayName UserDisplayName UserDisplayName

Gets or sets a user name associated with the UserDataAccount that is suitable for displaying.

public : Platform::String UserDisplayName { get; set; }
public string UserDisplayName { get; set; }
Public ReadWrite Property UserDisplayName As string
var string = userDataAccount.userDisplayName;
userDataAccount.userDisplayName = string;
Value
Platform::String string string string

A user name associated with the UserDataAccount that is suitable for displaying.

Methods

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

Asynchronously deletes all the contact, calendar and email data associated with the account.

public : IAsyncAction DeleteAsync()
public IAsyncAction DeleteAsync()
Public Function DeleteAsync() As IAsyncAction
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.deleteAsync().done( /* Your success and error handlers */ );
Returns

An async action indicating success or failure.

FindAppointmentCalendarsAsync() FindAppointmentCalendarsAsync() FindAppointmentCalendarsAsync() FindAppointmentCalendarsAsync()

Returns a collection of AppointmentCalendar instances associated with the UserDataAccount.

public : IAsyncOperation<IVectorView<AppointmentCalendar>> FindAppointmentCalendarsAsync()
public IAsyncOperation<IReadOnlyList<AppointmentCalendar>> FindAppointmentCalendarsAsync()
Public Function FindAppointmentCalendarsAsync() As IAsyncOperation<IReadOnlyList<AppointmentCalendar>>( Of IVectorView )
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.findAppointmentCalendarsAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IVectorView<AppointmentCalendar>> IAsyncOperation<IReadOnlyList<AppointmentCalendar>> IAsyncOperation<IReadOnlyList<AppointmentCalendar>> IAsyncOperation<IReadOnlyList<AppointmentCalendar>>

A collection of AppointmentCalendar instances associated with the UserDataAccount.

FindContactAnnotationListsAsync() FindContactAnnotationListsAsync() FindContactAnnotationListsAsync() FindContactAnnotationListsAsync()

Returns a collection of ContactAnnotationList instances associated with the UserDataAccount.

public : IAsyncOperation<IVectorView<ContactAnnotationList>> FindContactAnnotationListsAsync()
public IAsyncOperation<IReadOnlyList<ContactAnnotationList>> FindContactAnnotationListsAsync()
Public Function FindContactAnnotationListsAsync() As IAsyncOperation<IReadOnlyList<ContactAnnotationList>>( Of IVectorView )
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.findContactAnnotationListsAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IVectorView<ContactAnnotationList>> IAsyncOperation<IReadOnlyList<ContactAnnotationList>> IAsyncOperation<IReadOnlyList<ContactAnnotationList>> IAsyncOperation<IReadOnlyList<ContactAnnotationList>>

A collection of ContactAnnotationList instances associated with the UserDataAccount.

FindContactGroupsAsync() FindContactGroupsAsync() FindContactGroupsAsync() FindContactGroupsAsync()

This API supports the product infrastructure and is not intended to be used directly from your code.

Microsoft Internal Use Only.

public : IAsyncOperation<IVectorView<ContactGroup>> FindContactGroupsAsync()
public IAsyncOperation<IReadOnlyList<ContactGroup>> FindContactGroupsAsync()
Public Function FindContactGroupsAsync() As IAsyncOperation<IReadOnlyList<ContactGroup>>( Of IVectorView )
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.findContactGroupsAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IVectorView<ContactGroup>> IAsyncOperation<IReadOnlyList<ContactGroup>> IAsyncOperation<IReadOnlyList<ContactGroup>> IAsyncOperation<IReadOnlyList<ContactGroup>>

A collection of ContactGroup instances.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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

Returns a collection of ContactList instances associated with the UserDataAccount.

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

A collection of ContactList instances associated with the UserDataAccount.

FindEmailMailboxesAsync() FindEmailMailboxesAsync() FindEmailMailboxesAsync() FindEmailMailboxesAsync()

Returns a collection of EmailMailbox instances associated with the UserDataAccount.

public : IAsyncOperation<IVectorView<EmailMailbox>> FindEmailMailboxesAsync()
public IAsyncOperation<IReadOnlyList<EmailMailbox>> FindEmailMailboxesAsync()
Public Function FindEmailMailboxesAsync() As IAsyncOperation<IReadOnlyList<EmailMailbox>>( Of IVectorView )
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.findEmailMailboxesAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IVectorView<EmailMailbox>> IAsyncOperation<IReadOnlyList<EmailMailbox>> IAsyncOperation<IReadOnlyList<EmailMailbox>> IAsyncOperation<IReadOnlyList<EmailMailbox>>

A collection of EmailMailbox instances associated with the UserDataAccount.

FindUserDataTaskListsAsync() FindUserDataTaskListsAsync() FindUserDataTaskListsAsync() FindUserDataTaskListsAsync()

Returns a collection of UserDataTask instances associated with the UserDataAccount.

public : IAsyncOperation<IVectorView<UserDataTaskList>> FindUserDataTaskListsAsync()
public IAsyncOperation<IReadOnlyList<UserDataTaskList>> FindUserDataTaskListsAsync()
Public Function FindUserDataTaskListsAsync() As IAsyncOperation<IReadOnlyList<UserDataTaskList>>( Of IVectorView )
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.findUserDataTaskListsAsync().done( /* Your success and error handlers */ );
Returns
IAsyncOperation<IVectorView<UserDataTaskList>> IAsyncOperation<IReadOnlyList<UserDataTaskList>> IAsyncOperation<IReadOnlyList<UserDataTaskList>> IAsyncOperation<IReadOnlyList<UserDataTaskList>>

A collection of UserDataTask instances associated with the UserDataAccount.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

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

Asynchronously persists the UserDataAccount to the database.

public : IAsyncAction SaveAsync()
public IAsyncAction SaveAsync()
Public Function SaveAsync() As IAsyncAction
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.saveAsync().done( /* Your success and error handlers */ );
Returns

Async action that indicates completion of the save operation.

TryShowCreateContactGroupAsync() TryShowCreateContactGroupAsync() TryShowCreateContactGroupAsync() TryShowCreateContactGroupAsync()

This API supports the product infrastructure and is not intended to be used directly from your code.

Microsoft Internal Use Only.

public : IAsyncOperation<Platform::String> TryShowCreateContactGroupAsync()
public IAsyncOperation<string> TryShowCreateContactGroupAsync()
Public Function TryShowCreateContactGroupAsync() As IAsyncOperation( Of string )
Windows.ApplicationModel.UserDataAccounts.UserDataAccount.tryShowCreateContactGroupAsync().done( /* Your success and error handlers */ );
Returns
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)