Yep. we’re still running a challenge wherein you can Win a Nokia Windows Phone. The rules are detailed in the aforelinked post. We missed a night, to keep you on your toes, here is question 9, our third last as we have Friday and Monday remaining.

Question 9

One of the topics that can be challenging for developers is the application lifecycle model for Windows Phone. There are a number of aspects that you need to consider when developing your application to correctly handle fast application switching and tombstoning.

Give an example of an issue that you’ve faced that relates to the lifecycle of a Windows Phone application and how you have addressed it?

Tags: windows phone discussion
Nick is a software architect and developer with experience across a range of technologies, and has a particular interest in the future of rich client and mobile device applications. Nick is a speaker, author, a Microsoft MVP and owner of Built To Roam.

  • Craig Naumann

    I thought I was pretty comfortable saving and restoring states using the PhoneApplicationService State dictionary, until I added more and more pages. Trying to track that and restore when resuming from tombstone was a nightmare. It wasn’t until Nick (thanks, by the way) educated me in the fact that there was also the page State dictionary I could use in OnNavigatedFrom to save and OnNavigatedTo to restore page state. Now my tombstone code is much simplier.

  • Garth Bacon

    My app was being terminated before all the state data was being saved, and when it was reactivated it was missing data. I found this extract on MSDN which solved the probelm:

    “All of the application events have a limit of 10 seconds for the application to complete the tasks in the event handler. If an application exceeds this limit, it will be immediately terminated. For this reason, you should avoid performing resource-intensive tasks, such as reading from and writing to isolated storage within the handlers for the application events. These tasks should be performed on background threads while the application is running, whenever possible. Saving application data as it changes, throughout the lifetime of the application, reduces the amount of state management you need to perform during the application events.”

  • Nick

    The competition is now closed for entries. The following entries have been recorded for this question. If, for whatever reason, your entry is not in this list, please feel free to respond
    Craig Naumann (2 entries as first answer)
    Garth Bacon

  • çiçek gönder

    ye My app was being terminated before all the state data was being saved, I had this problem,

Special Offer
Free course!

Git into it! Bonus course Introduction to Git is yours when you take up a free 14 day SitePoint Premium trial.