Saving state when navigating. RRS feed

  • Question

  • Hi!

    I happen to have huge problem with navigation. Till now I've been using objects filled with data when navigating between pages ex. Frame->Navigate(TypeName(DetailsView::typeid), TooComplicatedObject); 

    Everything was working fine, but now I would like to use Resume event. The problem is that it's crashing the app as the page could not be suspended correctly due to this object passed as navigation parameter. It would't be a problem if the navigation was simple 1->2->3->2->1, then I would store object globally. My problem is that the navigatation can be more complicated ex. 1->3->3->3(...) or 1->2->3->3->3(...) (Each number is the same layout filled with different data). I thought about using navigation cache and then refreshing data when navigating to page(data has to be downloaded from server). But maybe there is some better sollution for such problem?

    • Edited by Ciamas Wednesday, October 2, 2013 6:10 PM
    Wednesday, October 2, 2013 6:07 PM


  • Well, couple of beers and I think the problem is solved;) I'm using Vector<Map<String^, Object^>^>^ and navigation counter in overriden OnNavigatedTo(). Navigation counter is incremented on navigating to and decremented on navigating back. Basically it is a kind of copy of standard OnNavigatedTo().

    Though if there is a better sollution please let me know. Wrote it in case smb had the same problem.

    • Edited by Ciamas Wednesday, October 2, 2013 9:25 PM
    • Marked as answer by Ciamas Wednesday, October 2, 2013 9:26 PM
    Wednesday, October 2, 2013 9:23 PM