Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.21 KB

backgroundtaskprogresseventargs.md

File metadata and controls

38 lines (28 loc) · 1.21 KB
-api-id -api-type
T:Windows.ApplicationModel.Background.BackgroundTaskProgressEventArgs
winrt class

Windows.ApplicationModel.Background.BackgroundTaskProgressEventArgs

-description

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

-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 + "%.";
    });
}

-see-also