Application.EnteredBackground イベント

定義

アプリがフォアグラウンドからバックグラウンドに移動したときに発生します。

public:
 virtual event EnteredBackgroundEventHandler ^ EnteredBackground;
// Register
event_token EnteredBackground(EnteredBackgroundEventHandler const& handler) const;

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

// Revoke with event_revoker
Application::EnteredBackground_revoker EnteredBackground(auto_revoke_t, EnteredBackgroundEventHandler const& handler) const;
public event EnteredBackgroundEventHandler EnteredBackground;
function onEnteredBackground(eventArgs) { /* Your code */ }
application.addEventListener("enteredbackground", onEnteredBackground);
application.removeEventListener("enteredbackground", onEnteredBackground);
- or -
application.onenteredbackground = onEnteredBackground;
Public Custom Event EnteredBackground As EnteredBackgroundEventHandler 

イベントの種類

Windows の要件

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

注釈

このイベントは、ユーザーがアプリから離れると発生します。 このイベントのイベント ハンドラーを実行できる時間は限られています。

アプリがバックグラウンドに移行すると、システムにより強制されるメモリ制限が変化する場合があります。 このイベントを使用して、現在のメモリ消費量と空きリソースをチェックして、アプリが中断され、バックグラウンドで終了しないようにします。 詳細については、「 アプリがバックグラウンドに移動したときにメモリを解放 する」を参照してください。

EnteredBackground イベントは、登録されたアパートメントで実行されます。

適用対象

こちらもご覧ください