CoreApplication.LeavingBackground イベント

定義

アプリケーション UI が表示される直前に発生します。

// Register
static event_token LeavingBackground(EventHandler<LeavingBackgroundEventArgs> const& handler) const;

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

// Revoke with event_revoker
static CoreApplication::LeavingBackground_revoker LeavingBackground(auto_revoke_t, EventHandler<LeavingBackgroundEventArgs> const& handler) const;
public static event System.EventHandler<LeavingBackgroundEventArgs> LeavingBackground;
function onLeavingBackground(eventArgs) { /* Your code */ }
Windows.ApplicationModel.Core.CoreApplication.addEventListener("leavingbackground", onLeavingBackground);
Windows.ApplicationModel.Core.CoreApplication.removeEventListener("leavingbackground", onLeavingBackground);
- or -
Windows.ApplicationModel.Core.CoreApplication.onleavingbackground = onLeavingBackground;
Public Shared Custom Event LeavingBackground As EventHandler(Of LeavingBackgroundEventArgs) 

イベントの種類

Windows の要件

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

注釈

以前は、UI を読み込むのに最適な場所は、アクティブ化または再開イベント ハンドラーでした。 これで、最終的なチェックを行い、UI がプレゼンテーションの準備ができていることを確認するために、LeavingBackground イベントのハンドラーが最適な場所になりました。 この時点でビジュアル アセットの準備が完了していることを確認すること重要です。これが、ユーザーに対してアプリが表示される前に処理を実行する最後の機会であるためです。

適用対象

こちらもご覧ください