public async Task <bool> ResumeAsync(Template10StartArgs e) { if (!Settings.RunRestoreStrategy) { return(false); } if (!IsResuming(e)) { return(false); } if (e.StartKind == StartKinds.Launch) { foreach (var nav in NavigationServiceHelper.Instances.Select(x => x as INavigationServiceInternal)) { if (await nav.LoadAsync(true)) { // } else { return(false); } } } return(true); }
public bool IsResuming(Template10StartArgs e) { if (Settings.AppAlwaysResumes && e.StartKind == StartKinds.Launch && e.StartCause == StartCauses.Primary) { return(true); } if (e.ThisIsPrelaunch) { return(false); } if (!e.ThisIsFirstStart) { return(false); } switch (e.PreviousExecutionState) { // if the app was previous suspended (and not terminated) case ApplicationExecutionState.Suspended: // if the app was previous suspended (and terminate) case ApplicationExecutionState.Terminated: case ApplicationExecutionState.NotRunning: default: return(false); } }
public async override Task StartupAsync(Template10StartArgs e) { if (Settings.AutoExtendExecutionSession) { await(this as IExtendedSessionStrategyInternal).StartUnspecifiedAsync(); } }
public async override Task OnStartAsync(Template10StartArgs e) { Windows.UI.Xaml.Window.Current.VisibilityChanged += (s, args) => { Debug.WriteLine($"Window Visible: {args.Visible}"); }; switch (e.StartKind) { case StartKinds.Prelaunch: case StartKinds.Launch: case StartKinds.Activate: await NavigationService.NavigateAsync(typeof(Views.MainPage)); break; case StartKinds.Background: break; } }
public abstract Task StartupAsync(Template10StartArgs e);