BackgroundTaskRegistrationGroup.BackgroundActivated 事件

定義

當屬於群組的背景工作啟動時,就會引發此事件。

// 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) 

事件類型

範例

背景啟用範例 如需群組工作範例,請參閱案例 6。

備註

與群組相關聯的背景觸發程式會引發此事件,而不是有工作進入點。 對於未在其背景工作註冊中定義進入點的單一進程背景工作,此事件是進入點。 呼叫附加至群組的事件,而不是呼叫應用程式的 OnBackgroundActivated 方法。

適用於

另請參閱