共用方式為


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方法來取得下一頁的結果。

如果目前的使用者未登入 Store,StoreProductPagedQueryResult傳回值的ExtendedError屬性會傳回錯誤碼0x80070525 (ERROR_NO_SUCH_USER) 。

注意

一律使用 HasMoreResults 來判斷是否有更多可用頁面,即使目前的資料頁面包含的專案少於 maxItemsToRetrievePerPage也一樣。 為了提供更快速的結果,即使有更多可用的資料頁面,服務仍可傳回頁面比 maxItemsToRetrievePerPage 少的專案。

適用於