c# - The state-preserving dictionary isn't preserving state -


i have followed tutorial here preserve state between pages.

however, state dictionary empty, when programatically navigate page! seems problem here?

i have tested behaviour on emulator 8.0.10322 720p.

this do:

    protected override void onnavigatedfrom(navigationeventargs e)     {         base.onnavigatedfrom(e);          if (e.navigationmode != navigationmode.back)         {             state["is"] = resultslist.itemssource;             state["si"] = resultslist.selecteditem;             state["dgtest"] = new data();             state["test"] = "gi2";         }     }      protected override void onnavigatedto(navigationeventargs e)     {         base.onnavigatedto(e);          if (e.isnavigationinitiator && e.navigationmode != navigationmode.back)         {             resultslist.itemssource = (system.collections.ilist) state["is"];             resultslist.selecteditem = state["si"];         }     } 

the objects in itemssource of type data, defined here:

[datacontract] public class data {     [datamember]     public string datum { get; set; } } 

edit: programatically navigate back, i'm calling navigationservice.navigate(new uri("/mypages/page.xaml", urikind.relative));


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -