Dela via


BackgroundTaskRegistrationGroup.BackgroundActivated Event

Definition

This event is fired when a background task that belongs to a group starts.

// Register
event_token BackgroundActivated(TypedEventHandler<BackgroundTaskRegistrationGroup, BackgroundActivatedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
BackgroundTaskRegistrationGroup::BackgroundActivated_revoker BackgroundActivated(auto_revoke_t, TypedEventHandler<BackgroundTaskRegistrationGroup, BackgroundActivatedEventArgs const&> const& handler) const;
public event TypedEventHandler<BackgroundTaskRegistrationGroup,BackgroundActivatedEventArgs> BackgroundActivated;
function onBackgroundActivated(eventArgs) { /* Your code */ }
backgroundTaskRegistrationGroup.addEventListener("backgroundactivated", onBackgroundActivated);
backgroundTaskRegistrationGroup.removeEventListener("backgroundactivated", onBackgroundActivated);
- or -
backgroundTaskRegistrationGroup.onbackgroundactivated = onBackgroundActivated;
Public Custom Event BackgroundActivated As TypedEventHandler(Of BackgroundTaskRegistrationGroup, BackgroundActivatedEventArgs) 

Event Type

Examples

Background activation sample See scenario 6 for a grouped task example.

Remarks

Background triggers associated with a group fire this event instead of having a task entry point. For single-process background tasks that don't define an entry point in their background task registration, this event is the entry point. Instead of calling the application's OnBackgroundActivated method, the event attached to the group is called.

Applies to

See also