IBackgroundTaskRegistration IBackgroundTaskRegistration IBackgroundTaskRegistration IBackgroundTaskRegistration Interface

Provides access to a registered background task.

Syntax

Declaration

public interface IBackgroundTaskRegistrationpublic interface IBackgroundTaskRegistrationPublic Interface IBackgroundTaskRegistrationpublic interface IBackgroundTaskRegistration

Properties summary

Gets the name of a registered background task.

Gets the identifier of a registered background task.

Methods summary

Unregisters a registered background task.

Events summary

Attaches a completed event handler to the registered background task.

Attaches a progress event handler to the registered background task.

Properties

  • Name
    Name
    Name
    Name

    Gets the name of a registered background task.

    public string Name { get; }public string Name { get; }Public ReadOnly Property Name As stringpublic string Name { get; }

    Property Value

    • string
      string
      string
      string

      The description specified with Name when the task was created.

  • TaskId
    TaskId
    TaskId
    TaskId

    Gets the identifier of a registered background task.

    public Guid TaskId { get; }public Guid TaskId { get; }Public ReadOnly Property TaskId As Guidpublic Guid TaskId { get; }

    Property Value

    • System.Guid
      System.Guid
      System.Guid
      System.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(Boolean cancelTask)public void Unregister(Boolean cancelTask)Public Function Unregister(cancelTask As Boolean) As voidpublic void Unregister(Boolean cancelTask)

    Parameters

    • cancelTask
      System.Boolean
      System.Boolean
      System.Boolean
      System.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 Completedpublic abstract event BackgroundTaskCompletedEventHandler Completed
  • 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 Progresspublic abstract event BackgroundTaskProgressEventHandler Progress

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.ApplicationModel.Background.dll