BackgroundTaskProgressEventArgs class

Applies to Windows and Windows Phone

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

Syntax


Public NotInheritable Class BackgroundTaskProgressEventArgs

Attributes

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

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

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

 

 

Show:
© 2014 Microsoft