Share via


BackgroundTaskRegistrationGroup Class

Definition

Provides grouping semantics so that background task registration can be maintained separately.

public ref class BackgroundTaskRegistrationGroup sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationGroupFactory, 262144, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BackgroundTaskRegistrationGroup final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Background.IBackgroundTaskRegistrationGroupFactory), 262144, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BackgroundTaskRegistrationGroup
function BackgroundTaskRegistrationGroup(id, name)
Public NotInheritable Class BackgroundTaskRegistrationGroup
Inheritance
Object Platform::Object IInspectable BackgroundTaskRegistrationGroup
Attributes

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v4.0)

Examples

Background activation sample
Background task sample See scenario 6 for a grouped task example.

Remarks

Developers are encouraged to unregister, and then register, all background tasks used by the application when the app launches. However, in addition to unregistering the app's background tasks, this can also unregister background tasks registered by frameworks used by the app.

Grouped background task registration provides roughly the equivalent of a namespace for background tasks. You can register/unregister background tasks that belong to a group that you define without disturbing the registration of other background tasks on the device.

Constructors

BackgroundTaskRegistrationGroup(String, String)

Creates a BackgroundTaskRegistrationGroup with the specified group ID and

BackgroundTaskRegistrationGroup(String)

Creates a BackgroundTaskRegistrationGroup with the specified group ID.

Properties

AllTasks

Gets all of the background tasks that belong to the group.

Id

Gets the group ID.

Name

Gets the friendly name of the group.

Events

BackgroundActivated

This event is fired when a background task that belongs to a group starts.

Applies to