I'm having trouble with my WP8 app. It uses the MVVM light library for the creation of the ViewModel and is also used for the page navigation with Messages.
Right now I'm having some problems with the OnNavigatedTo Method of my MainPage. If I start the app for the first time, it is called once. If I close and reopen it with the back button, it is also only called once. The constructor of my MainPage ViewModel will also be called only once.
If I let the application open in the background and exit with the Start or Search button, OnNavigatedTo will be called twice! The constructor will not be called any more.
My problem is now, that I'm initialising in the OnNavigatedTo a synchronsiation with a server. This should only be done once, but now it is sometimes called twice because of the double call of OnNavigatedTo. My understanding of the WP8 app model was that OnNavigatedTo will be only called once when I enter the page. I cannot understand this behaviour and it is driving me nuts.
I'm not using the FastAppResume and just want the normal behaviour back. Any advice would be really appreciated! I've checked all calls where I could have possibly loaded the page twice, but this did not help. Besides this problem, my app behaves like it should. I'm otherwise looking for a solution to create an async task which can be executed only one at a time.