StoreContext.GetForUser(User) StoreContext.GetForUser(User) StoreContext.GetForUser(User) StoreContext.GetForUser(User) 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 user) const;
public static StoreContext GetForUser(User user)
Public Shared Function GetForUser(user As User) As StoreContext
var storeContext = Windows.Services.Store.StoreContext.getForUser(user);

Parameters

user
User 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.

See also