ScheduledTaskAgent.OnInvoke Method

May 11, 2014

Called when the Scheduled Task is executed. Override this method and provide the code that should execute in the background.

Namespace:  Microsoft.Phone.Scheduler
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

Protected Friend MustOverride Sub OnInvoke ( _
	task As ScheduledTask _


Type: Microsoft.Phone.Scheduler.ScheduledTask
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

Windows Phone

© 2014 Microsoft