public void SaveNavigation() { DebugWrite($"Frame: {FrameFacade.FrameId}"); if (CurrentPageType == null) { return; } var args = new CancelEventArgs <Type>(FrameFacade.CurrentPageType); BeforeSavingNavigation?.Invoke(this, args); if (args.Cancel) { return; } var state = FrameFacade.PageStateSettingsService(GetType()); if (state == null) { throw new InvalidOperationException("State container is unexpectedly null"); } state.Write <string>("CurrentPageType", CurrentPageType.AssemblyQualifiedName); state.Write <object>("CurrentPageParam", CurrentPageParam); state.Write <string>("NavigateState", FrameFacade?.GetNavigationState()); }
bool RaiseBeforeSavingNavigation() { var args = new CancelEventArgs <Type>(CurrentPageType); BeforeSavingNavigation?.Invoke(this, args); return(args.Cancel); }
void INavigationService2.RaiseBeforeSavingNavigation(out bool cancel) { var args = new CancelEventArgsEx <Type>(CurrentPageType); BeforeSavingNavigation?.Invoke(this, args); cancel = args.Cancel; }
public async Task SaveAsync() { DebugWrite($"Frame: {FrameFacadeInternal.FrameId}"); if (CurrentPageType == null) { return; } var args = new CancelEventArgs <Type>(FrameFacadeInternal.CurrentPageType); BeforeSavingNavigation?.Invoke(this, args); if (args.Cancel) { return; } var state = FrameFacadeInternal.PageStateSettingsService(GetType().ToString()); if (state == null) { throw new InvalidOperationException("State container is unexpectedly null"); } state.Write <string>("CurrentPageType", CurrentPageType.AssemblyQualifiedName); state.Write <object>("CurrentPageParam", CurrentPageParam); state.Write <string>("NavigateState", FrameFacadeInternal?.NavigationService.NavigationState); await Task.CompletedTask; }
public void SaveNavigation() { if (CurrentPageType == null) { return; } var args = new CancelEventArgs <Type>(FrameFacade.CurrentPageType); BeforeSavingNavigation?.Invoke(this, args); if (args.Cancel) { return; } var state = FrameFacade.PageStateContainer(GetType()); if (state == null) { throw new InvalidOperationException("State container is unexpectedly null"); } state["CurrentPageType"] = CurrentPageType.AssemblyQualifiedName; state["CurrentPageParam"] = ParameterSerializationService.Instance.SerializeParameter(CurrentPageParam); state["NavigateState"] = FrameFacade?.GetNavigationState(); }