Represents an asynchronous operation, which returns a result upon completion. This is the return type for many Windows Runtime asynchronous methods that have results but don't report progress.
public interface class IAsyncOperation : IAsyncInfo
template <typename TResult> __interface IAsyncOperation : IAsyncInfo
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.FoundationContract), 65536)] [Windows.Foundation.Metadata.Guid(2680336571, 58438, 17634, 170, 97, 156, 171, 143, 99, 106, 242)] public interface IAsyncOperation<TResult> : IAsyncInfo
Public Interface IAsyncOperation(Of TResult) Implements IAsyncInfo
Windows 10 requirements
Windows 10 (introduced in 10.0.10240.0)
Windows.Foundation.FoundationContract (introduced in v1.0)
IAsyncOperation<TResult> is the return type for many Windows Runtime asynchronous methods that have a result upon completion, but don't report progress. This constitutes over 650 different Windows Runtime APIs. APIs that do report progress (and have a result) use another interface, IAsyncOperationWithProgress;.
Instead of using IAsyncOperation<TResult>, some Windows Runtime asynchronous methods use custom operation types. For example, DataReaderLoadOperation is a Windows Runtime type that implements IAsyncOperation using uint as the result type. The DataReaderLoadOperation type is then used as the custom operation/result type for the DataReader.LoadAsync method.
Notes to implementers
As with calling the existing methods, there are language-specific ways to define asynchronous methods that don't use IAsyncOperation<TResult> directly. If writing code using .NET, your method can return a Task<TResult>. For C++/CX, you can use the Concurrency runtime. However, if you're defining a component, you can use Task/task internally but you must return one of the Windows Runtime interfaces for your public methods. The language-specific asynchronous support types (and many other language-specific types you might conventionally use in code) can't be used for the public surface area of a Windows Runtime component.
Gets or sets the method that handles the operation completed notification.
Gets a string that describes an error condition of the asynchronous operation.(Inherited from IAsyncInfo)
Gets the handle of the asynchronous operation.(Inherited from IAsyncInfo)
Gets a value that indicates the status of the asynchronous operation.(Inherited from IAsyncInfo)
Cancels the asynchronous operation.(Inherited from IAsyncInfo)
Closes the asynchronous operation.(Inherited from IAsyncInfo)
Returns the results of the operation.