I'm setting a global variable to null before navigating to the mainpage and in the mainpage I check to see if that variable is null of not, but It isn't.
It seems to be behaving correctly when I slow down the execution using breakpoints.
Otherwise Doing a
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
straight after setting something in app just makes that not work.
Are there any considerations that I am missing, because I fe开发者_Python百科ar that the issue could be anywhere in the app (i've looked for anything that sets it back, and there's also nothing running in between Navigate and it landing on MainPage
You could try using on the mainPage, OnNavigatedFrom page event and under that change the value to Null. Also Handle your app with Tombstoning appropriately and back up persistent Data, Even have it load that Persistent Data when you navigate to a new page and then check to make sure that valued reference is Null.
I do hope this helps you, i have recently had an issue similar.
精彩评论