Share via


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.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BackgroundTaskRegistration final : 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)]
class BackgroundTaskRegistration final : IBackgroundTaskRegistration2, IBackgroundTaskRegistration3
[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)]
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)]
public sealed class BackgroundTaskRegistration : IBackgroundTaskRegistration2, IBackgroundTaskRegistration3
Public NotInheritable Class BackgroundTaskRegistration
Implements IBackgroundTaskRegistration2
Public NotInheritable Class BackgroundTaskRegistration
Implements IBackgroundTaskRegistration2, IBackgroundTaskRegistration3
Inheritance
Object Platform::Object IInspectable BackgroundTaskRegistration
Attributes
Implements

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

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

TaskLastThrottledInStandbyTimestamp
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