OnInvoke Method
Collapse the table of content
Expand the table of content

ScheduledTaskAgent.OnInvoke Method

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

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

protected internal abstract void OnInvoke(
	ScheduledTask task


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

© 2017 Microsoft