/// <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="pageState">An empty dictionary to be populated with serializable state.</param>
 protected override void SaveState(SaveStateEventArgs e) // WAS: SaveState(Dictionary<String, Object> pageState)
 {
     var pageState = e.PageState;
     var selectedItem = this.flipView.SelectedItem;
     // TODO: Derive a serializable navigation parameter and assign it to pageState["SelectedItem"]
     pageState["SelectedItem"] = ((SampleDataItem)(this.flipView.SelectedItem)).UniqueId; // Problem on back from Edit if: = selectedItem;//Glenn just tries this
 }
 /// <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="pageState">An empty dictionary to be populated with serializable state.</param>
 protected override void SaveState(SaveStateEventArgs e) // WAS: SaveState(Dictionary<String, Object> pageState)
 {
 }
 protected virtual void SaveState(SaveStateEventArgs e) { }
        /// <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>
// WAS:        /// <param name="pageState">An empty dictionary to be populated with serializable state.</param>
        protected override void SaveState(SaveStateEventArgs e)  //WAS:  protected override void SaveState(Dictionary<String, Object> pageState)
        {
            //dt.Stop();
            var pageState = e.PageState;
            if (this.itemsViewSource.View != null)
            {
                var selectedItem = (SampleDataItem)this.itemsViewSource.View.CurrentItem;
                if (selectedItem != null) pageState["SelectedItem"] = selectedItem.UniqueId;
            }
        }
 private void navigationHelper_SaveState(object sender, SaveStateEventArgs e)
 {
     SaveState(e);
 }