Template10 - return user to the main page after resuming -
let's assume uwp app gets suspended , not used long time. when user opens app again (previous applicationexecutionstate
suspended
or terminated
), don't want user navigated page he/she viewing last (it became irrelevant since then), instead fresh navigation main page. how can using template10?
it seems when user returns app, template10 returns user page being viewed last. tried overriding onresuming
method in app.xaml.cs
, had no effect.
i had problem. solved saving bool property itwassuspended in localsettings of app. when onresumming activated set true property or when launched event raised set property false.
finally in pages in onnavigatedto value of property if property true navigate main page , clear stack.
here how use local settings
https://msdn.microsoft.com/library/windows/apps/windows.storage.applicationdata.localsettings.aspx
you can clear stack doing this
this.frame.backstack.clear();
please mark answer if it's useful you!
best regards
Comments
Post a Comment