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

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -