StoreContext.GetUserCollectionWithPagingAsync 方法

定义

获取用户为其购买的当前应用的加载项的 Microsoft Store 信息。 此方法支持分页以返回结果。

public:
 virtual IAsyncOperation<StoreProductPagedQueryResult ^> ^ GetUserCollectionWithPagingAsync(IIterable<Platform::String ^> ^ productKinds, unsigned int maxItemsToRetrievePerPage) = GetUserCollectionWithPagingAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StoreProductPagedQueryResult> GetUserCollectionWithPagingAsync(IIterable<winrt::hstring> const& productKinds, uint32_t const& maxItemsToRetrievePerPage);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StoreProductPagedQueryResult> GetUserCollectionWithPagingAsync(IEnumerable<string> productKinds, uint maxItemsToRetrievePerPage);
function getUserCollectionWithPagingAsync(productKinds, maxItemsToRetrievePerPage)
Public Function GetUserCollectionWithPagingAsync (productKinds As IEnumerable(Of String), maxItemsToRetrievePerPage As UInteger) As IAsyncOperation(Of StoreProductPagedQueryResult)

参数

productKinds

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

一个字符串数组,指定要检索其信息的加载项类型。 有关受支持的字符串值列表,请参阅 ProductKind 属性。

maxItemsToRetrievePerPage
UInt32

unsigned int

uint32_t

每页结果中要返回的最大加载项数。

返回

一个异步操作,该操作在成功完成时返回一个 StoreProductPagedQueryResult 对象,该对象提供对用户已购买的当前应用的加载项的 Microsoft Store 信息以及相关错误信息以及下一页结果的访问权限。

属性

注解

此方法类似于 GetUserCollectionAsync,其不同之处在于它使你能够使用分页检索加载项。 有关使用 GetUserCollectionAsync 的详细信息(包括代码示例),请参阅 获取应用和加载项的产品信息

使用 StoreProductPagedQueryResult 对象的 HasMoreResults 确定是否有其他结果页,并使用 GetNextAsync 方法获取下一页结果。

如果当前用户未登录到应用商店,StoreProductPagedQueryResult 返回值的 ExtendedError 属性将返回错误代码0x80070525 (ERROR_NO_SUCH_USER) 。

注意

始终使用 HasMoreResults 来确定是否有更多可用的页面,即使当前数据页包含的项目比 maxItemsToRetrievePerPage 少。 为了提供更快的结果,即使有更多的可用数据页,该服务在页面中返回的项目数可能比 maxItemsToRetrievePerPage 少。

适用于