public async Task <bool> LoadNavigationState(string id, IFrameFacade frame) { // get state var folder = ApplicationData.Current.LocalCacheFolder; var file = await folder.TryGetItemAsync(buildKey(id)) as StorageFile; if (file == null) { return(false); } // test date var setting = App.Settings.SuspensionStateExpires; var expires = DateTime.Now.Subtract(setting); var info = await file.GetBasicPropertiesAsync(); var expired = expires <= info.DateModified; if (expired) { return(false); } // set state var state = await FileIO.ReadTextAsync(file); frame.SetNavigationState(state); return(true); }
public async Task<bool> LoadNavigationState(string id, IFrameFacade frame) { // get state var folder = ApplicationData.Current.LocalCacheFolder; var file = await folder.TryGetItemAsync(buildKey(id)) as StorageFile; if (file == null) { return false; } // test date var setting = App.Settings.SuspensionStateExpires; var expires = DateTime.Now.Subtract(setting); var info = await file.GetBasicPropertiesAsync(); var expired = expires <= info.DateModified; if (expired) { return false; } // set state var state = await FileIO.ReadTextAsync(file); frame.SetNavigationState(state); return true; }
private void RestoreFrameNavigationState(IFrameFacade frame) { var frameState = GetSessionStateForFrame(frame); if (frameState.ContainsKey("Navigation")) { frame.SetNavigationState((String)frameState["Navigation"]); } }
private void RestoreFrameNavigationState(IFrameFacade frame) { var frameState = GetSessionStateForFrame(frame); if (frameState.ContainsKey(Constants.SessionStateKeyNavigation)) { frame.SetNavigationState((string)frameState[Constants.SessionStateKeyNavigation]); } }
/// <summary> /// Clears the navigation history. /// </summary> public void ClearHistory() { _frame.SetNavigationState("1,0"); }
private void RestoreFrameNavigationState(IFrameFacade frame) { var frameState = GetSessionStateForFrame(frame); if (frameState.ContainsKey("Navigation")) { frame.SetNavigationState((String)frameState["Navigation"]); } }
private void RestoreFrameNavigationState(IFrameFacade frame) { var frameState = GetSessionStateForFrame(frame); if (frameState.ContainsKey(Constants.SessionStateKeyNavigation)) { frame.SetNavigationState((string)frameState[Constants.SessionStateKeyNavigation]); } }
/// <summary> /// Restore the navigation with the navigation state. /// </summary> /// <param name="navigationState">The navigation state</param> public void SetNavigationState(string navigationState) { frameFacade.SetNavigationState(navigationState); }