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; ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.