IAsyncOperationWithProgress<TResult,TProgress>.Completed Property


Gets or sets the method that handles the operation completed notification.

AsyncOperationWithProgressCompletedHandler<TResult, TProgress> Completed();

void Completed(AsyncOperationWithProgressCompletedHandler<TResult, TProgress> handler);
public AsyncOperationWithProgressCompletedHandler<TResult,TProgress> Completed { get; set; }
Public Property Completed As AsyncOperationWithProgressCompletedHandler(Of TResult, TProgress)

Property Value


The method that handles the notification.


For example C++/WinRT code illustrating how to handle the Completed event, see Delegate types for asynchronous actions and operations.


The Windows Runtime enforces that this property can only be set once on an operation.

Generally, a completed AsyncOperationWithProgressCompletedHandler<TResult, TProgress> method called using awaitable syntax does nothing further than to return its result (an object of the TResult type) when it completes.

If you're implementing AsyncOperationWithProgressCompletedHandler<TResult, TProgress>, then the set implementation of Completed should store the handler, and the surrounding logic should invoke it when Close is called. The implementation should set the asyncStatus parameter of invoked callbacks appropriately if there is a Cancel call, Status is not Completed, errors occurred, and so on.

Applies to

See also