locked
UI on most pages blank when App_Activating RRS feed

  • Question

  • I understand the different application events and storing transient data and so forth. However, something that is eluding me is why, for example, when I exit with the start button, then come back in with the back button, most pages are blank, but some aren't. 

    For example, my MainPage and DetailsPage are blank, I can't navigate using the back button, but the application bar works, though I can't navigate to another page. However, the DictionaryPage works fine.

    I could understand if it was something relying on, say, a list of data being persisted, but that's not the case.

    Thanks for the help.


    Michael DiLeo

    Thursday, October 18, 2012 5:57 PM

Answers

  • I found the problem. I think that since I'm using AnimatedBasePage for my pages, which I found from codeplex, the base.OnNavigatedTo(e) was causing the problems.

    I solved it this way:
    bool leftapp = false;
    OnNavigatedTo(..)

      if (leftapp)
      { left app = false; return; }
       base.OnNavigatedTo(e)...
    }

       

    On NavigatedFrom(...)
    {
      if (e.Uri.OriginalString == "app://external/")
         leftapp = true;
    }


    Michael DiLeo

    • Marked as answer by mcd023 Friday, October 19, 2012 8:02 PM
    Friday, October 19, 2012 8:02 PM

All replies

  • The app restoration activity needed, when the app is activated, depends on whether the app came out of Dormant state or Tombstoned state.

    You can force the Tombstoned activation scenario by right clicking on your Project in Solution Explorer, clicking on the Debug tab and checking the "Tombstone upon deactivation while debugging". Add breakpoints at useful places and then single step.

    Reference:

    Execution Model for Windows Phone
    http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769557(v=vs.92).aspx

    -Mark


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

    Thursday, October 18, 2012 7:06 PM
  • I found the problem. I think that since I'm using AnimatedBasePage for my pages, which I found from codeplex, the base.OnNavigatedTo(e) was causing the problems.

    I solved it this way:
    bool leftapp = false;
    OnNavigatedTo(..)

      if (leftapp)
      { left app = false; return; }
       base.OnNavigatedTo(e)...
    }

       

    On NavigatedFrom(...)
    {
      if (e.Uri.OriginalString == "app://external/")
         leftapp = true;
    }


    Michael DiLeo

    • Marked as answer by mcd023 Friday, October 19, 2012 8:02 PM
    Friday, October 19, 2012 8:02 PM