[ 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)
Protected Friend MustOverride Sub OnInvoke ( _ task As ScheduledTask _ )
protected internal abstract void OnInvoke( ScheduledTask task )
The ScheduledTask object for which Invoke is being called.
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
Windows Phone OS
Supported in: 8.1, 8.0, 7.1