UserPicker 类

定义

包含用于允许用户在多用户方案中选择用户帐户的方法和属性。

public ref class UserPicker sealed
/// [Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class UserPicker final
/// [Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 196608)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class UserPicker final
[Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class UserPicker
[Windows.Foundation.Metadata.Activatable(196608, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 196608)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class UserPicker
function UserPicker()
Public NotInheritable Class UserPicker
继承
Object Platform::Object IInspectable UserPicker
属性

Windows 要求

设备系列
Windows 10 Anniversary Edition (在 10.0.14393.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v3.0 中引入)

构造函数

UserPicker()

创建新的 UserPicker。

属性

AllowGuestAccounts

获取或设置是否允许选取来宾帐户。

SuggestedSelectedUser

获取或设置一个建议的用户,以便选取器在 UI 中指示。

方法

IsSupported()

确定是否支持 UserPicker。

PickSingleUserAsync()

显示一个对话框,供用户选择用户帐户。 所选帐户已登录,与选择它的 IGameController 配对,并且可以使用 User 类获取。 此方法仅支持多用户设备和应用,如果从单个用户设备或应用调用,将引发异常。

适用于