I am working in windows 10 app. I am really confused when windows 10 app suspend and resume events are fired. I have below event in App.cs page, however, this event never fires.
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background
ApplicationSettingsHelper.SaveSettingsValue(ApplicationSettingsConstants.AppState, (short)AppState.Suspended);
ApplicationDataSource.saveRecent(Recent);
deferral.Complete();
}
I have also tried to add onsuspend event in MainPage load event using below code, but this is also never fired.
Application.Current.Suspending += Current_Suspending;
when does the event Onsuspend is fired and what is the difference between the two above method?
Thanks!