I have written a windows 8 store app (XAML/C#) which I have running on a Microsoft surface. The app is basically a data entry application which doesn't have any save buttons. Saving is performed automatically when jumping between pages or when the application is suspended.
However one senario I can't seem to catch is when the user closes the application (when the users swipes from the top to bottom of the screen).
So at the moment I subscribe to App.Current.Suspending and call save 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 niether of these methods are called when the application is closed.
Does anybody know of an event that gets fired when the app closes?
Thanks
Programs and apps downloaded from the Microsoft Store are installed in the following path by default: C:/Program Files/WindowsApps (Hidden items).
Select the Start button, and then select Settings > Update & Security > Troubleshoot, and then from the list select Windows Store apps > Run the troubleshooter. Press the Windows Key + S and type in services. msc. If Disabled, change it to Automatic, click Start and click OK.
Here are the most common causes for the Microsoft Store frequently crashing on Windows 10: Your Windows Store cache is damaged, corrupted, or you don't have enough available space on the drive. The time and date settings on your computer are incorrect. The Microsoft Store app is damaged or corrupted.
http://msdn.microsoft.com/en-US/library/windows/apps/xaml/hh465115.aspx
At the bottom it contains the following note:
A note about debugging using Visual Studio: Visual Studio prevents Windows from suspending an app that is attached to the debugger. This is to allow the user to view the Visual Studio debug UI while the app is running. When you're debugging an app, you can send it a suspend event using Visual Studio. Make sure the Debug Location toolbar is being shown, then click the Suspend icon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With