Handling App Termination and Resubscription to Transfer Events

,

When a BackgroundTransferRequest has been added to the BackgroundTransferService, you can store the value of the request’s RequestId property in isolated storage. This enables you to retrieve the request later if your app is terminated, and to continue monitoring the progress of your background request by resubscribing to the request’s TransferStatusChanged and TransferProgressChanged events.

The BackgroundTransferService.Find method is used to retrieve an existing request, like so:

BackgroundTransferRequest request
        = BackgroundTransferService.Find("request id string");
if (request != null)
{
    request.TransferStatusChanged += HandleUploadTransferStatusChanged;
    request.TransferProgressChanged += HandleTransferProgressChanged;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.155.216