AsyncInfo Class
Provides factory methods to construct representations of managed tasks that are compatible with Windows Runtime asynchronous actions and operations.
This API is not CLS-compliant.
Assembly: System.Runtime.WindowsRuntime (in System.Runtime.WindowsRuntime.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | Run(Func(Of CancellationToken, Task)) | Creates and starts a Windows Runtime asynchronous action by using a function that generates a started task. The task can support cancellation. |
![]() ![]() | Run(Of TResult)(Func(Of CancellationToken, Task(Of TResult))) | Creates and starts a Windows Runtime asynchronous operation by using a function that generates a started task that returns results. The task can support cancellation. |
![]() ![]() | Run(Of TProgress)(Func(Of CancellationToken, IProgress(Of TProgress), Task)) | Creates and starts a Windows Runtime asynchronous action that includes progress updates, by using a function that generates a started task. The task can support cancellation and progress reporting. |
![]() ![]() | Run(Of TResult, TProgress)(Func(Of CancellationToken, IProgress(Of TProgress), Task(Of TResult))) | Creates and starts a Windows Runtime asynchronous operation that includes progress updates, by using a function that generates a started task that returns results. The task can support cancellation and progress reporting. |
The factory methods take functions (represented by delegates) that create and start managed Task or Task(Of TResult) objects. When a factory method is called, it invokes the delegate to create a started task, and then creates a Windows Runtime asynchronous action or operation that represents the task. Each factory method returns one of the sub-interfaces of Windows.Foundation.IAsyncInfo.
The WindowsRuntimeSystemExtensions class provides the AsTask extension method overloads to convert Windows Runtime asynchronous actions and operations to tasks, and the AsAsyncAction and AsAsyncOperation(Of TResult) extension methods that convert started tasks to Windows Runtime actions and operations.

