Sdílet prostřednictvím


IAsyncOperation<TResult>.Completed Property

Definition

Gets or sets the delegate that is called when the operation completes.

AsyncOperationCompletedHandler<TResult> Completed();

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

Property Value

The delegate that is called when the operation completes.

Examples

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

Remarks

You're not allowed to set the Completed property more than once.

Most applications don't use the Completed property directly, but instead use a language-specific syntax for awaiting the completion of an asynchronous action, such as co_await (C++/WinRT), await (C#, Javascript), or then (Javascript, C++/CX).

If the Completed property is set after the action has already completed, then the action behaves as if it had completed immediately after the handler was received. Note that this can result in the handler being called before the Completed property setter has returned; possibly even from the same thread.

Applies to

See also