-api-id | -api-type |
---|---|
T:Windows.ApplicationModel.Background.BackgroundTaskProgressEventArgs |
winrt class |
Represents progress information for a task at the time a progress update notification is sent.
The system generates this class and passes it as an argument to the application's BackgroundTaskProgressEventHandler handler.
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 + "%.";
});
}