StoreContext.RequestDownloadStorePackageUpdatesAsync(IIterable<StorePackageUpdate>) StoreContext.RequestDownloadStorePackageUpdatesAsync(IIterable<StorePackageUpdate>) StoreContext.RequestDownloadStorePackageUpdatesAsync(IIterable<StorePackageUpdate>) StoreContext.RequestDownloadStorePackageUpdatesAsync(IIterable<StorePackageUpdate>) StoreContext.RequestDownloadStorePackageUpdatesAsync(IIterable<StorePackageUpdate>) Method

Definition

Attempts to download the specified package updates for the current app from the Microsoft Store. This method also displays a UI dialog that requests permission for the operation.

Important

This method must be called on the UI thread.

public : IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadStorePackageUpdatesAsync(IIterable<StorePackageUpdate> storePackageUpdates)
IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadStorePackageUpdatesAsync(IIterable<StorePackageUpdate> storePackageUpdates) const;
public IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> RequestDownloadStorePackageUpdatesAsync(IEnumerable<StorePackageUpdate> storePackageUpdates)
Public Function RequestDownloadStorePackageUpdatesAsync(storePackageUpdates As IEnumerable(Of StorePackageUpdate)) As IAsyncOperationWithProgress(Of StorePackageUpdateResultStorePackageUpdateStatus)
Windows.Services.Store.StoreContext.requestDownloadStorePackageUpdatesAsync(storePackageUpdates).done( /* Your success and error handlers */ );

Parameters

storePackageUpdates
IEnumerable<StorePackageUpdate> IEnumerable<StorePackageUpdate> IEnumerable<StorePackageUpdate>

The set of StorePackageUpdate objects that represent the updated packages to download.

Returns

An object that the caller can observe to track progress and completion for the operation. On successful completion, the result is a StorePackageUpdateResult object that provides info about the package updates.

Exceptions

COMException COMException COMException

If the ErrorCode property of the exception has the value 0x80070578 (ERROR_INVALID_WINDOW_HANDLE), this indicates that the method was not called on the UI thread. If you are calling this method in a desktop application that uses the Desktop Bridge, this can also indicate that you did not configure the StoreContext object to specify which application window is the owner window for modal dialogs shown by this method. For more information, see this article.

Remarks

To get the list of packages that have updates available, use the GetAppAndOptionalStorePackageUpdatesAsync method. After you download the packages, you can install them by using the RequestDownloadAndInstallStorePackageUpdatesAsync method. For more information about using this method, including a code example, see Download and install package updates for your app.

This operation will not block. The IAsyncOperationWithProgress object returned by this method will complete after the update packages are downloaded.

When you call this method, the OS displays a dialog that tells the user that an app update is available to download and asks the user's permission to proceed with the download. If the user does not grant permission to start the download, the OverallState property of the StorePackageUpdateResult return value has the value Canceled.

The method that you assign to handle Progress notifications is called one time for each step in the download process for each package in this request. The Progress handler receives a StorePackageUpdateStatus argument that provides info about the update package that raised the progress notification.

See also