February 2015
Intermediate to advanced
768 pages
26h 24m
English
For any type of background task other than playing audio, you have more work to do. You must create a class that implements an interface called IBackgroundTask, register the task, choose a trigger, and potentially more.
IBackgroundTask is a simple interface with a single Run method. The following dummy implementation does nothing other than show how to report progress and support cancellation, which are two features that can be leveraged by your app when it runs in the foreground:
public sealed class CustomBackgroundTask : IBackgroundTask { bool isCanceled; public void Run(IBackgroundTaskInstance taskInstance) { // Support cancellation taskInstance.Canceled ...
Read now
Unlock full access