Jaa


IAsyncAction.Completed Property

Definition

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

public:
 property AsyncActionCompletedHandler ^ Completed { AsyncActionCompletedHandler ^ get(); void set(AsyncActionCompletedHandler ^ value); };
AsyncActionCompletedHandler Completed();

void Completed(AsyncActionCompletedHandler handler);
public AsyncActionCompletedHandler Completed { get; set; }
var asyncActionCompletedHandler = iAsyncAction.completed;
iAsyncAction.completed = asyncActionCompletedHandler;
Public Property Completed As AsyncActionCompletedHandler

Property Value

The delegate that is called when the action 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