AsyncInfo.Run Method (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.
Assembly: System.Runtime.WindowsRuntime (in System.Runtime.WindowsRuntime.dll)
'Declaration Public Shared Function Run ( _ taskProvider As Func(Of CancellationToken, Task) _ ) As IAsyncAction
- Type: System.Func(Of CancellationToken, Task)
A delegate that represents the function that creates and starts the task. The started task is represented by the Windows Runtime asynchronous action that is returned. The function is passed a cancellation token that the task can monitor to be notified of cancellation requests; you can ignore the token if your task does not support cancellation.
Return ValueType: IAsyncAction
A started Windows.Foundation.IAsyncAction instance that represents the task that is generated by taskProvider.
This method passes a cancellation token to the function that is specified by taskProvider. This token provides a connection between Windows Runtime cancellation and .NET Framework task cancellation; if the action is canceled, the task is canceled. If your task does not support cancellation, ignore the token.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.