IBackgroundTaskRegistration IBackgroundTaskRegistration IBackgroundTaskRegistration IBackgroundTaskRegistration Interface

Definition

Provides access to a registered background task.

public : interface IBackgroundTaskRegistrationpublic interface IBackgroundTaskRegistrationPublic Interface IBackgroundTaskRegistration// You can use this interface in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Name Name Name Name

Gets the name of a registered background task.

public : PlatForm::String Name { get; }public string Name { get; }Public ReadOnly Property Name As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The description specified with BackgroundTaskBuilder.Name when the task was created.

TaskId TaskId TaskId TaskId

Gets the identifier of a registered background task.

public : PlatForm::Guid TaskId { get; }public Guid TaskId { get; }Public ReadOnly Property TaskId As Guid// You can use this property in JavaScript.
Value
PlatForm::Guid Guid Guid Guid

The unique identifier for the task. This identifier is generated by the system when the task is registered.

Methods

Unregister(Boolean) Unregister(Boolean) Unregister(Boolean) Unregister(Boolean)

Unregisters a registered background task.

public : void Unregister(bool cancelTask)public void Unregister(Boolean cancelTask)Public Function Unregister(cancelTask As Boolean) As void// You can use this method in JavaScript.
Parameters
cancelTask
bool Boolean Boolean Boolean

True if currently running instances of this background task should be canceled. If this parameter is false, currently running instances of this background task should be allowed to finish. Canceled instances receive a Canceled event with a BackgroundTaskCancellationReason of Abort.

Events

Completed Completed Completed Completed

Attaches a completed event handler to the registered background task.

public : abstract event BackgroundTaskCompletedEventHandler Completedpublic abstract event BackgroundTaskCompletedEventHandler CompletedPublic MustInherit Event Completed// You can use this event in JavaScript.

Progress Progress Progress Progress

Attaches a progress event handler to the registered background task.

public : abstract event BackgroundTaskProgressEventHandler Progresspublic abstract event BackgroundTaskProgressEventHandler ProgressPublic MustInherit Event Progress// You can use this event in JavaScript.