StoreContext.RequestUninstallStorePackageAsync(Package) 方法

定義

嘗試卸載目前應用程式的指定選擇性套件。 這個方法也會顯示要求作業許可權的 UI 對話方塊。

public:
 virtual IAsyncOperation<StoreUninstallStorePackageResult ^> ^ RequestUninstallStorePackageAsync(Package ^ package) = RequestUninstallStorePackageAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StoreUninstallStorePackageResult> RequestUninstallStorePackageAsync(Package const& package);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StoreUninstallStorePackageResult> RequestUninstallStorePackageAsync(Package package);
function requestUninstallStorePackageAsync(package)
Public Function RequestUninstallStorePackageAsync (package As Package) As IAsyncOperation(Of StoreUninstallStorePackageResult)

參數

package
Package

要針對目前應用程式卸載的選擇性套件。

傳回

在成功完成時,非同步作業會傳回 StoreUninstallStorePackageResult 物件,該物件會提供卸載作業的相關資訊。

屬性

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Services.Store.StoreContract (已於 v3.0 引進)

備註

您可以卸載不再需要的選用套件,以使用此方法釋放磁碟空間。 例如,在使用者完成該行銷活動之後,提供單一玩家行銷活動和多人遊戲活動的遊戲可能會使用此方法來卸載使用者要求的單一玩家活動。

當您呼叫此方法時,OS 會顯示對話方塊,詢問使用者卸載應用程式套件的許可權。 若要以無訊息方式卸載應用程式套件而不顯示通知對話方塊,請使用 UninstallStorePackageAsyncUninstallStorePackageByStoreIdAsync (這些方法需要存取受限制的功能) 。

注意

選用套件和 DLC 套件不適用於所有開發人員帳戶。

適用於

另請參閱