public void OnNavigatedTo(MtNavigationEventArgs e) { if (PageKey != null) // new instance { return; } var frameState = MtSuspensionManager.SessionStateForFrame(_page.Frame); PageKey = "Page" + _page.Frame.BackStackDepth; if (e.NavigationMode == NavigationMode.New) { var nextPageKey = PageKey; var nextPageIndex = _page.Frame.BackStackDepth; while (frameState.Remove(nextPageKey)) { nextPageIndex++; nextPageKey = "Page" + nextPageIndex; } // Does not make sense when no page state is available... //var args = new MtLoadStateEventArgs(e.Parameter, null); //var copy = LoadState; //if (copy != null) // copy(this, args); _page.LoadState(e.Parameter, null); //_page.OnLoadState(args); } else { var pageState = (Dictionary <String, Object>)frameState[PageKey]; var args = new MtLoadStateEventArgs(e.Parameter, pageState); var copy = LoadState; if (copy != null) { copy(this, args); } _page.LoadState(e.Parameter, pageState); _page.OnLoadState(args); } }
public void OnNavigatedTo(MtNavigationEventArgs e) { if (!_stateLoaded) { var frameState = MtSuspensionManager.SessionStateForFrame(_page.Frame); if (e.NavigationMode == NavigationMode.New) { var nextPageKey = PageKey; var nextPageIndex = _page.Frame.BackStackDepth; while (frameState.Remove(nextPageKey)) { nextPageIndex++; nextPageKey = "Page" + nextPageIndex; } // Does not make sense when no page state is available... //var args = new MtLoadStateEventArgs(e.Parameter, null); //var copy = LoadState; //if (copy != null) // copy(this, args); _page.LoadState(e.Parameter, null); //_page.OnLoadState(args); } else { var pageState = (Dictionary<String, Object>)frameState[PageKey]; var args = new MtLoadStateEventArgs(e.Parameter, pageState); var copy = LoadState; if (copy != null) copy(this, args); _page.LoadState(e.Parameter, pageState); _page.OnLoadState(args); } _stateLoaded = true; } }
/// <summary>Used to load the saved state when the page has been reactivated. </summary> /// <param name="pageState">The saved page state. </param> public void OnLoadState(MtLoadStateEventArgs pageState) { // TODO: Load the view model state. }
protected override void OnLoadState(MtLoadStateEventArgs pageState) { Model.Filter = pageState.Get <string>("Filter"); }
protected override void OnLoadState(MtLoadStateEventArgs pageState) { MyTextBox.Text = pageState.Get<string>("MyTextBox"); }
/// <summary>Used to load the saved state when the page has been reactivated. </summary> /// <param name="pageState">The saved page state. </param> protected internal virtual void OnLoadState(MtLoadStateEventArgs pageState) { // Must be empty }
protected override void OnLoadState(MtLoadStateEventArgs pageState) { MyTextBox.Text = pageState.Get <string>("MyTextBox"); }
/// <summary>Used to load the saved state when the page has been reactivated. </summary> /// <param name="pageState">The saved page state. </param> public void OnLoadState(MtLoadStateEventArgs pageState) { SampleProperty = pageState.Get <string>("SampleProperty"); }
protected override void OnLoadState(MtLoadStateEventArgs pageState) { Model.Filter = pageState.Get<string>("Filter"); }
/// <summary>Used to load the saved state when the page has been reactivated. </summary> /// <param name="pageState">The saved page state. </param> public void OnLoadState(MtLoadStateEventArgs pageState) { SampleProperty = pageState.Get<string>("SampleProperty"); }