Save data when the Windows 8 Store application closes

I wrote a Windows 8 storage application (XAML / C #) that runs on the surface of Microsoft for me. An application is a data entry application that does not have save buttons. Saving is performed automatically when switching between pages or when the application is paused.

However, one senario that I can’t catch is when the user closes the application (when users move from top to bottom).

So, at the moment I am subscribing to App.Current.Suspending and the save call is here:

App.Current.Suspending += Current_Suspending;                  

void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
{
    Save();
}

I also override the SaveState method and call "Save here":

protected override void SaveState(Dictionary<string, object> pageState)
{
    Save();
    base.SaveState(pageState);
}

But none of these methods are called when the application is closed.

Does anyone know of an event that fires when the application closes?

thank

+5
2

http://msdn.microsoft.com/en-US/library/windows/apps/xaml/hh465115.aspx

:

Visual Studio: Visual Studio Windows , . Visual Studio . , suspend Visual Studio. , "" , "".

+6

Windows Store, . , , , ALT-F4 Windows Store, , . , / .

, , . , , NotRunning 10 . | , , . .

, , . , Windows . - , , Windows, , Windows. . ClosedByUser Terminated ApplicationExecutionState.

, . , , . , Windows .

+2

All Articles