WindowsRuntimeSystemExtensions.AsTask(TResult, TProgress) Method (IAsyncOperationWithProgress(TResult, TProgress))
Returns a task that represents a Windows Runtime asynchronous operation returns a result.
Assembly: System.Runtime.WindowsRuntime (in System.Runtime.WindowsRuntime.dll)
static member AsTask : source:IAsyncOperationWithProgress<'TResult, 'TProgress> -> Task<'TResult>
The type of object that returns the result of the asynchronous operation.
The type of object that provides data that indicates progress.
- Type: IAsyncOperationWithProgress(, )
The asynchronous operation.
Return ValueType: System.Threading.Tasks.Task()
A task that represents the asynchronous operation.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type IAsyncOperationWithProgress(, ). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
source is a null reference (Nothing in Visual Basic).
Calling this method overload is equivalent to calling the AsTask(TResult, TProgress)(IAsyncOperationWithProgress(TResult, TProgress), IProgress(TProgress)) extension method overload and specifying a null reference (Nothing in Visual Basic) for the progress parameter. This is useful when you don't want to get progress reports from an operation that reports progress.
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.