I navigate between pages using the navigation assistant class added by VS 2013 when creating the solution. But the scroll state of most controls (for example, Pivot, Hub) is not saved, as in Windows Phone 8.x Silverlight.
What should I do to implement this behavior? Do I have to handle the scroll state myself and restore the scroll when I return to the visited page?
Thanks.
Update1:
I need to save the selected pivot / hub element etc. when I return to the page.
UPDATE2:
void navigationHelper_SaveState(obj sender,SaveStateEventArgs e) { e.PageState["SelectedSection"] = MainHub.SectionsInView; } void navigationHelper_LoadState(obj sender,LoadStateEventArgs e) { if (e.PageState != null) { var sections = e.PageState["SelectedSection"] as IList<HubSection>; if (sections != null && sections.Any()) MainHub.ScrollToSection(sections[0]); } }
source share