示例#1
0
        // public methods

        public UIElement CreateRoot(IStartArgsEx e)
        {
            LogThis();
            if (CreateRootElementDelegate?.Invoke(e) is UIElement result && result != null)
            {
                return(result);
            }
示例#2
0
        public async Task <bool> ResumeAsync(IStartArgsEx e)
        {
            if (!Settings.EnableLifecycleStrategy)
            {
                return(false);
            }

            if (!IsResuming(e))
            {
                return(false);
            }

            PreviouslySuspended = false;

            if (e?.StartKind == StartArgsEx.StartKinds.Launch)
            {
                foreach (var nav in NavigationService.Instances.Select(x => x as INavigationService2))
                {
                    if (await nav.LoadAsync(true, Windows.UI.Xaml.Navigation.NavigationMode.New))
                    {
                        continue;
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
        public bool IsResuming(IStartArgsEx e)
        {
            if (Settings.AppAlwaysResumes &&
                e?.StartKind == StartArgsEx.StartKinds.Launch &&
                e?.StartCause == StartArgsEx.StartCauses.Primary)
            {
                return(true);
            }

            if (e?.LaunchActivatedEventArgs?.PrelaunchActivated ?? false)
            {
                return(false);
            }

            if (!e.ThisIsFirstStart)
            {
                return(false);
            }

            switch (e.PreviousExecutionState)
            {
            // if the app was previous suspended (and not terminated)
            case ApplicationExecutionState.Suspended:
                return(true);

            // if the app was previous suspended (and terminate)
            case ApplicationExecutionState.Terminated:
            case ApplicationExecutionState.NotRunning:
            default:
                return(false);
            }
        }
示例#4
0
 public async Task StartupAsync(IStartArgsEx e)
 {
     if (Settings.EnableExtendedSessionStrategy)
     {
         await Two.StartUnspecifiedAsync();
     }
 }
示例#5
0
        public override UIElement CreateRootElement(IStartArgsEx e)
        {
            var shellPage = new ShellPage();

            shellPage.MainNavView.Frame.RegisterNavigationService();
            return(shellPage);
        }
示例#6
0
        public override async Task OnStartAsync(IStartArgsEx e, INavigationService navService, ISessionState sessionState)
        {
            await Task.Delay(0);

            if (await navService.NavigateAsync(PageKeys.MainPage))
            {
                HideSplash();
            }
        }
示例#7
0
        public override async Task OnStartAsync(IStartArgsEx e, INavigationService navService, ISessionState sessionState)
        {
            await Task.Delay(0);

            if (await navService.NavigateAsync(PageKeys.MainPage.ToString()))
            {
                if (PopupsExtensions.TryGetPopup <SplashPopup>(out var splash) && splash.IsShowing)
                {
                    splash.IsShowing = false;
                }
            }
        }
 public async Task StartupAsync(IStartArgsEx e) => await Two.StartUnspecifiedAsync();
示例#9
0
 public override async Task OnStartAsync(IStartArgsEx e)
 {
     await NavigationService.NavigateAsync(typeof(Views.MainPage));
 }
示例#10
0
 public abstract Task StartupAsync(IStartArgsEx e);
示例#11
0
 public override async Task OnStartAsync(IStartArgsEx e, INavigationService navService, ISessionState sessionState)
 {
     var args = e.LaunchActivatedEventArgs?.Arguments;
     await navService.NavigateAsync(typeof(MainPage), args);
 }
示例#12
0
 public override async Task OnStartAsync(IStartArgsEx e, INavigationService navService, ISessionState sessionState)
 {
     await navService.NavigateAsync(typeof(Views.MainPage));
 }