Beispiel #1
0
        /// <summary>
        /// Gets the main page.
        /// </summary>
        /// <returns>The Main Page.</returns>
        public static Page GetMainPage()
        {
            // Register our views with our view models
            ViewFactory.Register<MvvmSamplePage, MvvmSampleViewModel>();
            ViewFactory.Register<NewPageView, NewPageViewModel>();
            ViewFactory.Register<GeolocatorPage, GeolocatorViewModel>();
            ViewFactory.Register<CameraPage, CameraViewModel>();
            ViewFactory.Register<CacheServicePage, CacheServiceViewModel>();
            ViewFactory.Register<SoundPage, SoundServiceViewModel>();
            ViewFactory.Register<RepeaterViewPage, RepeaterViewViewModel>();
            ViewFactory.Register<WaveRecorderPage, WaveRecorderViewModel>();

            var mainTab = new ExtendedTabbedPage()
            {
                Title = "XLabs",
                SwipeEnabled = true,
                TintColor = Color.White,
                BarTintColor = Color.Blue,
                Badges = { "1", "2", "3" },
                TabBarBackgroundImage = "ToolbarGradient2.png",
                TabBarSelectedImage = "blackbackground.png",
            };

            var mainPage = new NavigationPage(mainTab);

            Resolver.Resolve<IDependencyContainer>()
                .Register<INavigationService>(t => new NavigationService(mainPage.Navigation));

            mainTab.CurrentPageChanged += () => Debug.WriteLine("ExtendedTabbedPage CurrentPageChanged {0}", mainTab.CurrentPage.Title);

            var controls = GetControlsPage(mainPage);
            var services = GetServicesPage(mainPage);
            var charts = GetChartingPage(mainPage);
            var samples = GetSamplesPage(mainPage);

            var mvvm = ViewFactory.CreatePage<MvvmSampleViewModel, Page>();

            mainTab.Children.Add(controls);
            mainTab.Children.Add(services);
            mainTab.Children.Add(charts);
            mainTab.Children.Add(mvvm as Page);
            mainTab.Children.Add(samples);

            return mainPage;
        }
Beispiel #2
0
        public RootPage()
        {



            if (!App.ToolBarItemsInitialised)
                InitToolBarItems();


            var menuPage = new MenuPage();
            menuPage.Title = App.CurrentTitle;
            Title = App.CurrentTitle;
            menuPage.Menu.ItemSelected += (sender, e) => NavigateTo(e.SelectedItem as LocalMenuItem);
            MasterBehavior = MasterBehavior.Popover;
            Master = menuPage;
            BackgroundColor = Color.White;



            /*Main menu when at rest*/
            MainTabbedPage = new ExtendedTabbedPage
            {

                Title = App.CurrentTitle,
                Padding = new Thickness(5, 5, 5, 5),
                Children =
                  {


                    new SoftLaunchSplashPage() {Title = "Launch", Padding = new Thickness(5, 5, 5, 5)},
                 /*     new AccidentSplashPage() {Title = "Accident", Padding = new Thickness(5, 5, 5, 5)},*/
                      new FirstTimeWelcomePage() {Title = "Setup"},
                        new SignUpPage() { Title = "Sign Up"},

                /*    new AccidentLocationPage(App.parentViewModel)
                      {
                          Title = "  Locate",
                          Padding = new Thickness(5, 5, 5, 5)
                      },
*/
                      new TakePhotoPage(),
                      
                      
                      /*,
                       carousel   ,
                      new RecordAudioPage(parentViewModel.Media.Where(x=>x.MimeType == "mp4").ToList()) {Title = "  Record"},
                      new OCRPage {Title = "  OCR"}*/


                  }
            };


            /*
                        MainTabbedPage.TintColor = Color.FromHex("#4A04F7");
                        MainTabbedPage.BarTintColor = Color.FromHex("#4A04F7");
                        MainTabbedPage.BackgroundColor = Color.FromHex("#4A04F7");*/
            MainNavigationPage = new NavigationPage(MainTabbedPage)
            {
                BarBackgroundColor = Color.FromHex("#4A04F7"),
                BarTextColor = Color.White

            };

            /*  MainNavigationPage = new NavigationPage(new SignUpPage())
              {
                  BarBackgroundColor = Color.FromHex("#4A04F7"),
                  BarTextColor = Color.White

              };*/
            Detail = MainNavigationPage;




            /*Decide which page to pop onto now*/

         
            RedirectToCorrectLaunchPage();



        }