IAsyncAction.Completed IAsyncAction.Completed IAsyncAction.Completed IAsyncAction.Completed IAsyncAction.Completed Property

Definition

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

public : AsyncActionCompletedHandler Completed { get; set; }
AsyncActionCompletedHandler Completed();

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

Property Value

Examples

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

Remarks

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.

See also