I have an OberservableCollection that contains data. To check its contents I use a loop that contains MessageBox.Show("...")
in order to show each value on the screen.
That works great with the exception that I can not end the app before the end of the loop. That means that the loop is not interrupted on push of home button (Windows logo button). On push the start screen appears, but there are still message boxes that are created by the loop.
Same behavior on emulator and device (Windows Phone 7.8).
Can anyone help me with that please?
Thank you very much in advance.
Use OnNavigatedFrom event to find out when the user left the page where the loop started. Set a flag to signal this. Each iteration of the loop check for the value of that flag and if the user already navigated away from your page, just break the loop.