CoreApplication.EnteredBackground CoreApplication.EnteredBackground CoreApplication.EnteredBackground CoreApplication.EnteredBackground Event


Fired when the app enters the running in the background state.

public : event EventHandler<EnteredBackgroundEventArgs> EnteredBackground
// Register
event_token EnteredBackground(EventHandler<EnteredBackgroundEventArgs> const& handler) const;

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

// Revoke with event_revoker
EnteredBackground_revoker EnteredBackground(auto_revoke_t, EventHandler<EnteredBackgroundEventArgs> const& handler) const;
public event EventHandler<EnteredBackgroundEventArgs> EnteredBackground
Public Event EnteredBackground As EventHandler (Of EnteredBackgroundEventArgs)


This event is fired when your app is no longer visible in the foreground.

Previously your suspending callback was the best place to save state after a user finished a session with your app. However, now an application may continue running in the background and then move back to the foreground due to trigger activity without ever reaching the suspended state. The best place to save data after a user session is in your entered background event handler.

Memory limits also change as an app moves into the background. It is best to check the MemoryManager and release memory if needed to ensure your app does not get terminated.

See also