SystemUI.ShowPeoplePickerAsync Method

Asynchronously allows a title to prompt a user with a system overlay menu to select other users, and presents a list of the selected users.

Syntax

public:
static IAsyncOperation<IVectorView<String^ >^ >^ ShowPeoplePickerAsync(
         IUser^ requestingUser,
         String^ promptText,
         IVectorView<String^ >^ selectFromUserIdList,
         IVectorView<String^ >^ preselectedUserIdList,
         uint32 minimumSelectionCount,
         uint32 maximumSelectionCount
)  

Parameters

requestingUser
Type: IUser 

The user making the request.

promptText
Type: String 

 Text telling why the user is selecting people. The string provided can have a maximum of 50 characters, and can be empty.

selectFromUserIdList
Type: IVectorView<String^ > 

  The collection of Xbox user IDs of the people to pick from. This list can reflect a maximum of 100 people.

preselectedUserIdList
Type: IVectorView<String^ > 

  The collection of Xbox user IDs of people that are preselected. The IDs in this list must be present in the list described for selectFromUserIdList. The list can be empty. The length of the list must not be greater than the value of maximumSelectionCount.

minimumSelectionCount
Type: uint32 

 Minimum number of people that must be selected before the user can click the Done button. This number can be zero. The number must not be greater than the value of maximumSelectionCount.

maximumSelectionCount
Type: uint32 

 Maximum number of people that can be selected. maximumSelectionCount can not be greater than the size of selectFromUserIdList.

Return value

Type: IAsyncOperation<IVectorView<String^ >^ > 

Returns an IAsyncOperation<TResult> object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncOperation<TResult>.Completed property. When the asynchronous operation is complete, the result of the operation can be retrieved by using the IAsyncOperation<TResult>.GetResults method.

Result is a list of strings containing Xbox User IDs (XUIDs) of the selected users.

Remarks

If the user clicks the Done button, ShowPeoplePickerAsync completes the asynchronous operation. The return value is a list of the selected Xbox user IDs.

ShowPeoplePickerAsync cancels the asynchronous operation if the user clicks the Cancel button, or otherwise causes the people picker to disappear, for example, by clicking the nexus button or invoking a speech command. Upon cancellation, the method returns an empty list.

Requirements

Namespace: Windows.Xbox.UI

Metadata: windows.winmd

See also

Reference

SystemUI Class

SystemUI Members

Windows.Xbox.UI Namespace