CoreApplication.Suspending Event

Occurs when the app is suspending.

Syntax

public:
static event EventHandler<SuspendingEventArgs^ >^ Suspending {
         EventRegistrationToken add (EventHandler<SuspendingEventArgs^ >^ value);
         void remove (EventRegistrationToken token);
}  

Remarks

The suspend timeout for exclusive applications is one second. The suspend completion handler fires five seconds after a shared application becomes non-visible.

In the Suspending event handler, the game code should release any exclusive locks it may have on system-wide resources and save the game state. If the game has network connections open to other consoles or servers, then—depending on the nature of these connections—the game may also close these connections in the Suspending event handler. For example, in a multiplayer collaborative online game, the game should notify other players that a player is leaving the current game session as the game gets suspended.

See App States and White Papers - Process Lifetime Management for Xbox One for specific steps titles should take when being suspended.

Requirements

Namespace: Windows.ApplicationModel.Core

Metadata: windows.winmd

See also

Overview

App States

White Papers - Process Lifetime Management for Xbox One

Reference

CoreApplication Class

CoreApplication Members

Windows.ApplicationModel.Core Namespace

CoreApplication.Resuming Event

CoreApplicationView.Activated Event

CoreApplication.ResourceAvailabilityChanged Event