AudioGraphBackgroundPlayback.App.App_Suspending C# (CSharp) Method

App_Suspending() private method

Invoked when application execution is being suspended. Application state is saved without knowing whether the application will be terminated or resumed with the contents of memory still intact.
private App_Suspending ( object sender, SuspendingEventArgs e ) : void
sender object The source of the suspend request.
e Windows.ApplicationModel.SuspendingEventArgs Details about the suspend request.
return void
        private void App_Suspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();
            // Optional: Save application state and stop any background activity
            Debug.WriteLine("Suspending");
            deferral.Complete();
        }