CoreApplication.BackgroundActivated イベント

定義

アプリがバックグラウンド トリガーによってアクティブ化されたときに発生します。

// Register
static event_token BackgroundActivated(EventHandler<BackgroundActivatedEventArgs> const& handler) const;

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

// Revoke with event_revoker
static CoreApplication::BackgroundActivated_revoker BackgroundActivated(auto_revoke_t, EventHandler<BackgroundActivatedEventArgs> const& handler) const;
public static event System.EventHandler<BackgroundActivatedEventArgs> BackgroundActivated;
function onBackgroundActivated(eventArgs) { /* Your code */ }
Windows.ApplicationModel.Core.CoreApplication.addEventListener("backgroundactivated", onBackgroundActivated);
Windows.ApplicationModel.Core.CoreApplication.removeEventListener("backgroundactivated", onBackgroundActivated);
- or -
Windows.ApplicationModel.Core.CoreApplication.onbackgroundactivated = onBackgroundActivated;
Public Shared Custom Event BackgroundActivated As EventHandler(Of BackgroundActivatedEventArgs) 

イベントの種類

Windows の要件

デバイス ファミリ
Windows 10 Anniversary Edition (10.0.14393.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v3.0 で導入)

注釈

バックグラウンド トリガーを BackgroundTaskBuilder に登録しますが、 TaskEntryPoint は設定しないでください。 これにより、トリガーが通知されたときにこのイベントが発生します。 イベント ハンドラーには、IBackgroundTask.Run メソッドが提供するすべてのものを含む BackgroundActivatedEventArgs パラメーターがあります。

ヒント

アプリがバックグラウンド状態に入る頃には、その UI は表示されません。

適用対象

こちらもご覧ください