IAsyncAction.Completed Property


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

 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 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 action.

Generally, a completed IAsyncAction method called using language-specific awaitable syntax does nothing further than to return null when it completes.

If you're implementing IAsyncAction, 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