[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Called when the Scheduled Task is executed. Override this method and provide the code that should execute in the background.
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
Each application can have only one ScheduledTaskAgent associated with it. If you want to use both a PeriodicTask and a ResourceIntensiveTask for the same application, you can check the task parameter in OnInvoke to see which type of task it is and branch your code accordingly.
For more information about Scheduled Tasks, see Background agents for Windows Phone 8