The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

Saved State issue RRS feed

  • Question

  • Hello all,

    I have an app 'c#' that I am coding on and we ran into a problem. When the app launches it loads an image then loads a second image and begins a mediaelement and a pair of timers. These timers trigger fade events so that the title of the app and then the options appear. However when the  start button on the phone is pressed and then you attempt to relaunch the app from the back button it freezes  and will not continue to load. I know that I should be writting something into Application_Activated to restart the app properly but I am not able to find out what I would need to enter. Is it possible to have it launch the 'public void' that we are  using to start the app so that it doesn't try to load the non working dormant state? Any suggestions would be very helpful


    Friday, October 5, 2012 7:02 PM

All replies

  • Hi Colin,

    You will likely need to save app state at the time the user presses the Start button; save your state at the Application Deactivated event just before going into the dormant, and later tombstoned state. You may need to maintain a state variable that keeps track of the exact state of your phone, that takes into account pending timers etc. Then upon resume of your app you can set up a case statement that inspects the state variable and drives the action needed to restore your app to a valid working state.

    More info:
    Execution Model Overview for Windows Phone


    Mark Chamberlain Sr. Escalation Engineer | Microsoft Developer Support | Windows Phone 7

    Tuesday, October 9, 2012 4:02 PM