Пример #1
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {

#if DEBUG
            if (Debugger.IsAttached)
            {
                DebugSettings.EnableFrameRateCounter = true;
            }
#endif


            // Associate main region states with corresponding native pages
            LifecycleHelper.RegisterView<MainPage>().ForState(MainRegionView.Main);
            LifecycleHelper.RegisterView<SecondPage>().ForState(MainRegionView.Second);
            LifecycleHelper.RegisterView<ThirdPage>().ForState(MainRegionView.Third);
            LifecycleHelper.RegisterView<FourthPage>().ForState(MainRegionView.Fourth);

            // Register the sub-pages of the third page
            LifecycleHelper.RegisterView<ThrirdOnePage>().ForState(ThirdStates.One);
            LifecycleHelper.RegisterView<ThirdTwoPage>().ForState(ThirdStates.Two);
            LifecycleHelper.RegisterView<ThirdThreePage>().ForState(ThirdStates.Three);
            LifecycleHelper.RegisterView<ThirdFourPage>().ForState(ThirdStates.Four);

            // Register the page to be used in the additional window
            LifecycleHelper.RegisterView<SeparatePage>().ForState(SecondaryRegionView.Main);

            var core = new SampleApplication();
            var wm = new WindowManager(core);
            await core.Startup(builder =>
            {
                builder.Register<UWPSpecial,ISpecial>();
            });

        }
Пример #2
0
        private async void StartApplication()
        {

            // Handle when your app starts
            LifecycleHelper.RegisterView<MainPage>().ForState(MainRegionView.Main);
            LifecycleHelper.RegisterView<SecondPage>().ForState(MainRegionView.Second);
            LifecycleHelper.RegisterView<ThirdPage>().ForState(MainRegionView.Third);

            LifecycleHelper.RegisterView<SeparatePage>().ForState(SecondaryRegionView.Main);


            var core = new SampleApplication();
            var wm = new WindowManager(MainPage as CustomNavigationPage, core);
            await core.Startup(
                builder =>
            {
                builder.Register<XFormsSpecial, ISpecial>();
            });

            //            (MainPage as NavigationPage).Navigation.PushAsync(new MainPage());
        }