Exemplo n.º 1
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Loc.Init();
#if DEBUG
            if (Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            if (AppShell == null)
            {
                AppShell = new Shell();
                Loc.NavigationService.Initialize();
                ThreadUI.setDispatcher(NavigationFrame.Dispatcher);
                AppViewHelper.SetAppView();
                Window.Current.Activate();

                Loc.Main.AccountManager = new AccountManager();

                AppShell.Language = ApplicationLanguages.Languages[0];

                AppShell.NavigationFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }
            }
        }
Exemplo n.º 2
0
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            Loc.Init();
#if DEBUG
            if (Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            await WindowsAppInitializer.InitializeAsync("755097ed-7bf6-41a8-81c4-6d072579a7eb", WindowsCollectors.Metadata | WindowsCollectors.PageView | WindowsCollectors.Session | WindowsCollectors.UnhandledException);

            if (AppShell == null)
            {
                AppShell = new Shell();
                App.AppShell.GoToDarkTheme(Loc.Settings.IsApplicationThemeDark);
                Loc.NavigationService.Initialize();
                ThreadUI.setDispatcher(NavigationFrame.Dispatcher);
                AppViewHelper.SetAppView();
                Window.Current.Activate();

                Loc.Main.AccountManager = new AccountManager();

                AppShell.Language = ApplicationLanguages.Languages[0];

                AppShell.NavigationFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }
            }
        }