BackgroundTaskBuilder.TaskEntryPoint | taskEntryPoint property

Applies to Windows and Windows Phone

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

Syntax

Public Property TaskEntryPoint As String

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

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

Remarks

Windows Store apps 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.

Windows Store apps 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.

The following example shows a BackgroundTaskBuilder being used to register a JavaScript background task:


var builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder();
builder.taskEntryPoint = "js\\backgroundtask.js";

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.ApplicationModel.Background
Windows::ApplicationModel::Background [C++]

Metadata

Windows.winmd

See also

BackgroundTaskBuilder

 

 

Show:
© 2014 Microsoft