Share via


WebUIBackgroundTaskInstanceRuntimeClass.Canceled Event

Definition

Attaches a cancellation event handler to the background task instance.

public:
 virtual event BackgroundTaskCanceledEventHandler ^ Canceled;
// Register
event_token Canceled(BackgroundTaskCanceledEventHandler const& handler) const;

// Revoke with event_token
void Canceled(event_token const* cookie) const;

// Revoke with event_revoker
WebUIBackgroundTaskInstanceRuntimeClass::Canceled_revoker Canceled(auto_revoke_t, BackgroundTaskCanceledEventHandler const& handler) const;
public event BackgroundTaskCanceledEventHandler Canceled;
function onCanceled(eventArgs) { /* Your code */ }
webUIBackgroundTaskInstanceRuntimeClass.addEventListener("canceled", onCanceled);
webUIBackgroundTaskInstanceRuntimeClass.removeEventListener("canceled", onCanceled);
- or -
webUIBackgroundTaskInstanceRuntimeClass.oncanceled = onCanceled;
Public Custom Event Canceled As BackgroundTaskCanceledEventHandler Implements Canceled

Event Type

Implements

Remarks

In most cases, JavaScript background tasks continue to run until the Web Workers close method is called. The system shuts down a background task only when all apps are being closed, for example user log off or system shut down. In that case, Windows fires the canceled event, enabling the background task to complete any final activity before it is closed.

Applies to