StoreProduct 類別

定義

代表 Microsoft Store 中可用的產品。

public ref class StoreProduct sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Services.Store.StoreContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class StoreProduct final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Services.Store.StoreContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class StoreProduct
Public NotInheritable Class StoreProduct
繼承
Object Platform::Object IInspectable StoreProduct
屬性

Windows 需求

裝置系列
Windows 10 Anniversary Edition (已於 10.0.14393.0 引進)
API contract
Windows.Services.Store.StoreContract (已於 v1.0 引進)

備註

市集中的產品會組織在 產品SKU可用性 物件的階層中。 產品會以 StoreProduct 物件表示。 每個產品的 SKU 均以 StoreSku 物件表示,而每個 SKU 的可用性則由 StoreAvailability 物件表示。 如需詳細資訊,請參閱 App 內購買和試用版

若要擷取目前應用程式的 StoreProduct 物件,請使用 GetStoreProductForCurrentAppAsync 方法。

若要擷取可從目前應用程式內購買之產品的 StoreProduct 物件,請使用這些方法。

屬性

Description

從 Microsoft Store 清單取得產品描述。

ExtendedJsonData

以 JSON 格式從市集取得產品的完整資料。

HasDigitalDownload

取得值,指出產品是否有選擇性的可下載內容 (DLC) 。

Images

從產品的 Windows 市集清單中取得影像。

InAppOfferToken

如果目前的 StoreProduct 代表附加元件,則取得本產品的產品識別碼。

IsInUserCollection

取得值,這個值表示目前使用者是否有權使用產品的預設 SKU。

Keywords

取得與 合作夥伴中心產品相關聯的關鍵字。 此屬性僅適用于代表附加元件的 StoreProduct 物件。 這些字串會對應至合作夥伴中心附加元件的 [屬性] 頁面中的 [關鍵字] 欄位值。

Language

取得產品之 Microsoft Store 清單中資料的語言。

LinkUri

取得產品的 Microsoft Store 清單 URI。

Price

取得預設 SKU 和產品可用性的價格。

ProductKind

取得產品的型別。 目前支援這些值: ApplicationGameConsumableUnmanagedConsumableDurable

Skus

取得產品的可用 SKU 清單。

StoreId

取得此產品的市集識別碼。

Title

從 Microsoft Store 清單中取得產品標題。

Videos

從產品的 Windows 市集清單中取得影片。

方法

GetIsAnySkuInstalledAsync()

指出此產品的任何 SKU 是否安裝在目前的裝置上。 此方法適用于具有可下載內容的產品, (DLC) 。

RequestPurchaseAsync()

要求購買產品的預設 SKU 和可用性,並顯示用來透過 Microsoft Store 完成交易的 UI。

重要

必須在 UI 執行緒上呼叫這個方法。

RequestPurchaseAsync(StorePurchaseProperties)

要求購買產品的預設 SKU 和可用性,並顯示用來透過 Microsoft Store 完成交易的 UI。 這個方法提供選項,以在 Microsoft Store 中的單一清單所代表的大型產品目錄中指定特定供應專案的其他詳細資料,包括購買期間向使用者顯示的產品名稱。

重要

必須在 UI 執行緒上呼叫這個方法。

適用於

另請參閱