BackgroundTaskRegistrationGroup.BackgroundActivated Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.