Windows Dev Center

BackgroundTaskProgressEventArgs class

Represents progress information for a task at the time a progress update notification is sent.

Syntax


/* For information about creating or accessing this object, see Remarks. */

Members

The BackgroundTaskProgressEventArgs class has these types of members:

Properties

The BackgroundTaskProgressEventArgs class has these properties.

PropertyAccess typeDescription

InstanceId

Read-onlyGets the identifier of the background task instance for this progress status notification.

Progress

Read-onlyGets progress status for a background task instance.

 

Remarks

The system generates this class and passes it as an argument to the application's BackgroundTaskProgressEventHandler handler.

Examples

The following example shows how to use the BackgroundTaskProgressEventArgs class with a BackgroundTaskProgressEventHandler delegate to show background task progress while the app is in the foreground.



private async void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
{
    //
    // UI element updates should be done asynchronously.
    //
    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
    () =>
    {
        ExampleProgressElement.Text = "Progress is at " args.Progress + "%.";
    });
}

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Background
Windows::ApplicationModel::Background [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.ApplicationModel.Background
Windows::ApplicationModel::Background [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

See also

Object

 

 

Show:
© 2015 Microsoft