/// <summary> /// Preserves state associated with this page in case the application is suspended or the /// page is discarded from the navigation cache. Values must conform to the serialization /// requirements of <see cref="SuspensionManager.SessionState"/>. /// </summary> /// <param name="sender">The source of the event; typically <see cref="NavigationHelper"/></param> /// <param name="e">Event data that provides an empty dictionary to be populated with /// serializable state.</param> private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e) { e.PageState["MatchType"] = (this.DataContext as MainViewModel).MatchType; e.PageState["SearchString"] = (this.DataContext as MainViewModel).SearchString; e.PageState["IsResultsLoading"] = (this.DataContext as MainViewModel).IsResultsLoading; e.PageState["IsNoResultFound"] = (this.DataContext as MainViewModel).IsNoResultFound; e.PageState["Words"] = (this.DataContext as MainViewModel).Words; }
/// <summary> /// Preserves state associated with this page in case the application is suspended or the /// page is discarded from the navigation cache. Values must conform to the serialization /// requirements of <see cref="SuspensionManager.SessionState"/>. /// </summary> /// <param name="sender">The source of the event; typically <see cref="NavigationHelper"/></param> /// <param name="e">Event data that provides an empty dictionary to be populated with /// serializable state.</param> private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e) { }