Share via


Task Class

Definition

The Task class provides a way to create a background task.

public ref class Task sealed : IBackgroundTask
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.UniversalBackgroundTaskContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.UniversalBackgroundTaskContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class Task final : IBackgroundTask
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.UniversalBackgroundTaskContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.UniversalBackgroundTaskContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class Task : IBackgroundTask
function Task()
Public NotInheritable Class Task
Implements IBackgroundTask
Inheritance
Object Platform::Object IInspectable Task
Attributes
Implements

Constructors

Task()

Creates a new Task for the internal implementation of IBackgroundTask. It is used by Windows App SDK to receive the background task trigger and re-route the call to the full trust COM component registered by the application using the Windows App SDK API.

Methods

Run(IBackgroundTaskInstance)

A method that runs a provided background task.

Explicit Interface Implementations

IBackgroundTask.Run(IBackgroundTaskInstance)

This Run method gets invoked as the background task executes.

Applies to