Share via


StoreContext.GetForUser(User) Method

Definition

Gets a StoreContext object that can be used to access and manage Microsoft Store-related data for the specified user in the context of the current app.

public:
 static StoreContext ^ GetForUser(User ^ user);
 static StoreContext GetForUser(User const& user);
public static StoreContext GetForUser(User user);
function getForUser(user)
Public Shared Function GetForUser (user As User) As StoreContext

Parameters

user
User

An object that identifies the user whose Microsoft Store-related data you want to access and manage.

Returns

An object that you can use to access and manage Microsoft Store-related data for the specified user.

Remarks

If your app is a multi-user app, use the GetForUser method to get a StoreContext object that you can use to access and manage Microsoft Store-related data for a specific user who is signed in with their Microsoft account while using the app. For more information about this method, see In-app purchases and trials. For more information about multi-user apps, see Introduction to multi-user applications.

If your app is a single-user app (that is, it runs only in the context of the user that launched the app), use the GetDefault method to get a StoreContext object for the current user. Most Universal Windows Platform (UWP) apps are single-user apps.

Applies to

See also