コード例 #1
0
        public App()
        {
            InitializeComponent();

            var factory = new XamvvmFormsFactory(this);
            factory.RegisterNavigationPage<MainNavigationPageModel>(() => this.GetPageFromCache<MainPageModel>());
            XamvvmCore.SetCurrentFactory(factory);
            MainPage = this.GetPageFromCache<MainNavigationPageModel>() as NavigationPage;
        }
コード例 #2
0
        public App()
        {
            InitializeComponent();

            var factory = new XamvvmFormsFactory(this);

            factory.RegisterNavigationPage <MainNavigationPageModel>(() => this.GetPageFromCache <MainPageModel>());
            XamvvmCore.SetCurrentFactory(factory);
            MainPage = this.GetPageFromCache <MainNavigationPageModel>() as NavigationPage;
        }
コード例 #3
0
        public App()
        {
            InitializeComponent();

            var factory = new XamvvmFormsFactory(this);

            XamvvmCore.SetCurrentFactory(factory);

            MainPage = this.GetPageFromCache <AppShellModel>() as Page;
        }
コード例 #4
0
        public App()
        {
            FlowListView.Init();

            var factory = new XamvvmFormsFactory(this);

            factory.RegisterNavigationPage <MainNavigationPageModel>(() => this.GetPageAsNewInstance <MainPageModel>());
            XamvvmCore.SetCurrentFactory(factory);
            MainPage = this.GetPageFromCache <MainNavigationPageModel>() as Page;
        }
コード例 #5
0
        public App()
        {
            InitializeComponent();


            FlowListView.Init();

            var factory = new XamvvmFormsFactory(this);

            factory.RegisterTabbedPage <MainPageModel>(new Type[]
            {
                typeof(SchedulePageModel),
                typeof(LocationPageModel),
                typeof(NewsPageModel),
                typeof(VideoPageModel)
            }, true);
            //factory.RegisterTabbedPage<MainPageModel>(
            XamvvmCore.SetCurrentFactory(factory);



            var mainPage = this.GetPageFromCache <MainPageModel>() as MainPage;



            MainPage = new NavigationPage(mainPage)
            {
                BarBackgroundColor = Color.FromRgb(10, 79, 157),
                BarTextColor       = Color.White
            };
            //mainPage.DisplayAlert("1", "1", "1");

            //var schedulePage = this.GetPageFromCache<SchedulePageModel>() as SchedulePage;
            //var locationPage = this.GetPageFromCache<LocationPageModel>() as LocationPage;
            //var newsPage = this.GetPageFromCache<NewsPageModel>() as NewsPage;
            //var videoPage = this.GetPageFromCache<VideoPageModel>() as VideoPage;

            //mainPage.Children.Add(schedulePage);

            //mainPage.Children.Add(locationPage);

            //mainPage.Children.Add(newsPage);

            //mainPage.Children.Add(videoPage);

            //mainPage.BarBackgroundColor = Color.FromRgb(0, 34, 78);

            //mainPage.BarTextColor = Color.White;

            //MainPage = new NavigationPage(new MainPage())
            //{
            //	BarBackgroundColor = Color.FromRgb(0, 34, 78),
            //	BarTextColor = Color.White,
            //};
        }
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: krispy014/cp2
        public App()
        {
            // UWP
            //UnhandledException += async (sender, e) =>
            //{
            //    e.Handled = true;  // the magic! required to show popup!
            //    var dialog = new MessageDialog(e.Message, "UnhandledException caught!");
            //    await dialog.ShowAsync();
            //}

            InitializeComponent();

            //MessagingCenter.Subscribe<NavigationParamsModel>("NavigateMessage", async (arg1, arg2) =>
            //{
            //    // Just an example of how this would be done using Prism.Navigation.
            //    // Pure Xamarin.Forms navigation is obviously different.
            //    _navigationService.NavigateAsync(arg2.TargetPage);
            //});

            var factory = new XamvvmFormsFactory(this);

            factory.RegisterNavigationPage <MainNavigationPageModel>(() => this.GetPageFromCache <MasterDetailPageModel>());
            XamvvmCore.SetCurrentFactory(factory);

            // 본페이지
            //MainPage = this.GetPageFromCache<MainNavigationPageModel>() as NavigationPage;

            // 로그인페이지
            MainPage = new NavigationPage(new Login());


            //Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomainOnUnhandledException);
            //AppDomain.CurrentDomain.UnhandledException += (s, e) =>
            //{
            //    System.Diagnostics.Debug.WriteLine("AppDomain.CurrentDomain.UnhandledException: {0}. IsTerminating: {1}", e.ExceptionObject, e.IsTerminating);
            //};



            //MainPage = this.GetPageFromCache<MainNavigationPageModel>() as NavigationPage;


            //MainPage = new NavigationPage(new StartPage())
            //{
            //    BarBackgroundColor = Color.FromHex("CC0066"),
            //    BarTextColor = Color.FromHex("FFFFFF")
            //};

            //MainPage = new MainMenu();
            //MainPage = new NavigationPage(new MainPage());
        }
コード例 #7
0
ファイル: App.xaml.cs プロジェクト: kinavi/YouNotAlone
        public App()
        {
            InitializeComponent();

            FlowListView.Init();


            var factory = new XamvvmFormsFactory(this);

            factory.RegisterNavigationPage <MainNavigationPageModel>(() => this.GetPageFromCache <CategoryListModel>());

            XamvvmCore.SetCurrentFactory(factory);
            MainPage = this.GetPageFromCache <MainNavigationPageModel>() as NavigationPage;

            //MainPage = new NavigationPage(new CategoryListPage());//new MainPage();//
        }
コード例 #8
0
        public App()
        {
            App.Current.Resources = new ResourceDictionary()
            {
                { "CustomCacheKeyFactory", new CustomCacheKeyFactory() }
            };

            // Xamvvm init
            var factory = new XamvvmFormsFactory(this);

            factory.RegisterNavigationPage <MenuNavigationPageModel>(() => this.GetPageFromCache <MenuPageModel>());
            XamvvmCore.SetCurrentFactory(factory);
            MainPage = this.GetPageFromCache <MenuNavigationPageModel>() as Page;

            //ImageService.Instance.LoadCompiledResource("loading.png").Preload();
            //ImageService.Instance.LoadUrl("http://loremflickr.com/600/600/nature?filename=simple.jpg").DownloadOnly();
        }
コード例 #9
0
        public App()
        {
            InitializeComponent();

            var factory = new XamvvmFormsFactory(this);

            XamvvmCore.SetCurrentFactory(factory);

            /*
             * App.Current.Resources = new ResourceDictionary()
             * {
             *  { "CustomCacheKeyFactory", new CustomCacheKeyFactory() }
             * };
             *
             * // Xamvvm init
             * var factory = new XamvvmFormsFactory(this);
             * factory.RegisterNavigationPage<MenuNavigationPageModel>(() => this.GetPageFromCache<MenuPageModel>());
             * XamvvmCore.SetCurrentFactory(factory);
             * MainPage = this.GetPageFromCache<MenuNavigationPageModel>() as Page;
             */

            MainPage = new NavigationPage(new MainPage());
        }
コード例 #10
0
        public App()
        {
            InitializeComponent();

            var factory = new XamvvmFormsFactory(this);

            XamvvmCore.SetCurrentFactory(factory);

            factory.RegisterTabbedPage <MainPageViewModel>(() =>
            {
                return(new List <IBasePage <IBasePageModel> > {
                    new XamvvmNavigationPage(factory.GetPageFromCache <Page1ViewModel>() as Page)
                    {
                        Title = "Page1"
                    },
                    new XamvvmNavigationPage(factory.GetPageFromCache <Page2ViewModel>() as Page)
                    {
                        Title = "Page2"
                    },
                });
            });

            MainPage = this.GetPageFromCache <MainPageViewModel>() as Page;
        }
コード例 #11
0
        public App()
        {
            App.Current.Resources = new ResourceDictionary()
            {
                { "CustomCacheKeyFactory", new CustomCacheKeyFactory() }
            };

            CachedImage.FixedOnMeasureBehavior         = true;
            CachedImage.FixedAndroidMotionEventHandler = true;

            // Xamvvm init
            var factory = new XamvvmFormsFactory(this);

            factory.RegisterNavigationPage <MenuNavigationPageModel>(() => this.GetPageFromCache <MenuPageModel>());
            XamvvmCore.SetCurrentFactory(factory);
            //MainPage = this.GetPageFromCache<MenuNavigationPageModel>() as Page;

            var config = new FFImageLoading.Config.Configuration()
            {
                ExecuteCallbacksOnUIThread     = true,
                HttpReadTimeout                = 120,
                VerboseLogging                 = true,
                VerboseLoadingCancelledLogging = true,
                VerboseMemoryCacheLogging      = true,
                VerbosePerformanceLogging      = true,
                Logger = new Logger()
            };

            ImageService.Instance.Initialize(config);

            DependencyService.Register <MockDataStore>();
            MainPage = new MainPage();

            //ImageService.Instance.LoadCompiledResource("loading.png").Preload();
            //ImageService.Instance.LoadUrl("http://loremflickr.com/600/600/nature?filename=simple.jpg").DownloadOnly();
        }