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. */
Attributes
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The BackgroundTaskProgressEventArgs class has these types of members:
Methods
The BackgroundTaskProgressEventArgs class inherits methods from the Object class (C#/VB/C++).
Properties
The BackgroundTaskProgressEventArgs class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the identifier of the background task instance for this progress status notification. | |
| Read-only | Gets 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] |
|
Namespace |
|
|
Metadata |
|
Build date: 12/4/2012
