BackgroundTaskRegistration Class

Definition

Represents a background task that has been registered with the system.

public ref class BackgroundTaskRegistration sealed : IBackgroundTaskRegistration2
public ref class BackgroundTaskRegistration sealed : IBackgroundTaskRegistration2, IBackgroundTaskRegistration3
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BackgroundTaskRegistration sealed : IBackgroundTaskRegistration2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Static(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics, 65536, "Windows.Foundation.UniversalApiContract")]
class BackgroundTaskRegistration sealed : IBackgroundTaskRegistration2
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Static(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Static(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics2, 262144, "Windows.Foundation.UniversalApiContract")]
class BackgroundTaskRegistration sealed : IBackgroundTaskRegistration2, IBackgroundTaskRegistration3
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BackgroundTaskRegistration : IBackgroundTaskRegistration2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Static(typeof(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class BackgroundTaskRegistration : IBackgroundTaskRegistration2
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Static(typeof(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Static(typeof(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationStatics2), 262144, "Windows.Foundation.UniversalApiContract")]
public sealed class BackgroundTaskRegistration : IBackgroundTaskRegistration2, IBackgroundTaskRegistration3
Public NotInheritable Class BackgroundTaskRegistration
Implements IBackgroundTaskRegistration2
Public NotInheritable Class BackgroundTaskRegistration
Implements IBackgroundTaskRegistration2, IBackgroundTaskRegistration3
Inheritance
BackgroundTaskRegistration
Attributes
Implements

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

The system returns an instance of this class when the application calls the BackgroundTaskBuilder.Register method.

Version history

Windows version SDK version Value added
1703 15063 AllTaskGroups
1703 15063 GetTaskGroup
1703 15063 TaskGroup

Properties

AllTaskGroups

Gets the background task groups.

AllTasks

Enumerates an application's registered background tasks, except for the background tasks registered in a group with Windows.ApplicationModel.Background.BackgroundTaskBuilder.TaskGroup.

Name

Gets the name of a registered background task.

TaskGroup

Gets the BackgroundTaskRegistrationGroup that this BackgroundTaskRegistration is a part of.

TaskId

Gets the identifier of a registered background task.

Trigger

This is not intended for use in your code. For all unsupported trigger types, the value returned by this property is null.

Methods

GetTaskGroup(String)

Gets the task group object that is associated with the group identifier.

Unregister(Boolean)

Cancels the registration of a registered background task.

Events

Completed

Attaches a completed event handler to the registered background task.

Progress

Attaches a progress event handler to the registered background task.

Applies to