BackgroundTaskBuilder.TaskEntryPoint BackgroundTaskBuilder.TaskEntryPoint BackgroundTaskBuilder.TaskEntryPoint BackgroundTaskBuilder.TaskEntryPoint BackgroundTaskBuilder.TaskEntryPoint Property

Definition

Gets or sets the class that performs the work of a background task.

public : Platform::String TaskEntryPoint { get; set; }
winrt::hstring TaskEntryPoint();

void TaskEntryPoint(winrt::hstring taskentrypoint);
public string TaskEntryPoint { get; set; }
Public ReadWrite Property TaskEntryPoint As string
var string = backgroundTaskBuilder.taskEntryPoint;
backgroundTaskBuilder.taskEntryPoint = string;

Property Value

string string string

The name of an application-defined class that performs the work of a background task.

Remarks

UWP app using C++, C#, or Visual Basic The task entry point class must implement the IBackgroundTask interface. The system calls IBackgroundTask::Run when the background task is triggered. In addition, the class must be specified in the <Extensions> section of the application's manifest as <Extension Category="windows.backgroundTasks" EntryPoint="appNamespace.appClassName">.The task entry point class can be implemented in the same process as the application's foreground component (in-proc); however, it cannot run on any of the application's foreground threads because the application might be suspended when the background task is triggered. For best results, implement the class in a separate process (out-of-proc) to decouple it from the application's foreground components and allow the system to manage the application's processes more efficiently.

UWP app using JavaScript The entry point for a JavaScript background task is a JavaScript start page. See WebUIBackgroundTaskInstance.current for more information.Note that JavaScript background tasks must call close() to terminate when they are done, so they don't continue to consume the user's memory and battery.