UserPicker UserPicker UserPicker UserPicker Class

Definition

Contains methods and properties for allowing a user to select a user account in multi-user scenarios (such as on Xbox).

public : sealed class UserPicker : IUserPickerpublic sealed class UserPicker : IUserPickerPublic NotInheritable Class UserPicker Implements IUserPicker// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Constructors

UserPicker() UserPicker() UserPicker() UserPicker()

Creates a new UserPicker.

public : UserPicker()public UserPicker()Public Sub New()// You can use this method in JavaScript.

Properties

AllowGuestAccounts AllowGuestAccounts AllowGuestAccounts AllowGuestAccounts

Gets or sets whether picking guest accounts is allowed.

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

True if guest accounts are allowed; otherwise, false.

SuggestedSelectedUser SuggestedSelectedUser SuggestedSelectedUser SuggestedSelectedUser

Gets or sets a suggested user for the picker to indicate in the UI.

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

The suggested user.

Methods

IsSupported() IsSupported() IsSupported() IsSupported()

Gets if the user picker is supported. This property will return false for single user devices or apps, and true for multi-user devices (such as Xbox).

public : static PlatForm::Boolean IsSupported()public static bool IsSupported()Public Static Function IsSupported() As bool// You can use this method in JavaScript.
Returns
PlatForm::Boolean bool bool bool

True if the user picker is supported; otherwise, false.

PickSingleUserAsync() PickSingleUserAsync() PickSingleUserAsync() PickSingleUserAsync()

Displays a dialog for the user to pick a user account. The selected account is signed in, paired with the IGameController that selected it, and becomes obtainable using the User class. This method is only supported for multi-user devices and apps, and will throw an exception if called from a single user device or app.

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

When this method completes, it returns the selected user. If no user was selected, it returns null instead.