I have a UWP app, and I want to save my data when the user closes the application. I created an
OnSuspending event for when the app suspends and call my
Write() method to save data within it. When I activate the Suspend event when debugging, the code seems to work as intended (that is, the code saves). However, whenever I press the close button in the top right corner and close my app, when I start debugging again, it doesn't have the saved data.
Is this expected behavior? I know that when debugging you have to call the Suspending events manually. Is it just because I'm debugging, and once I actually deploy my app it will save as intended?