コード例 #1
0
        public App()
        {
            // Check the Device Target OS Platform
            if (Device.OS == TargetPlatform.Android)
            {
                // The root page of your application
                MainPage = new SplashPage();
            }
            else if (Device.OS == TargetPlatform.iOS)
            {
                // Set the Root page of your application
                var walksPage = new NavigationPage(new WalksPage()
                {
                    Title = "Track My Walks - iOS"
                });

                // Set the NavigationBar TextColor and Background Color
                walksPage.BarBackgroundColor = Color.FromHex("#440099");
                walksPage.BarTextColor       = Color.White;

                // Declare our DependencyService Interface
                var navService = DependencyService.Get <IWalkNavService>() as WalkNavService;
                navService.navigation = walksPage.Navigation;

                // Register our View Model Mappings between our ViewModels and Views (Pages)
                navService.RegisterViewMapping(typeof(WalksPageViewModel), typeof(WalksPage));
                navService.RegisterViewMapping(typeof(WalkEntryViewModel), typeof(WalkEntryPage));
                navService.RegisterViewMapping(typeof(WalksTrailViewModel), typeof(WalkTrailPage));
                navService.RegisterViewMapping(typeof(DistTravelledViewModel), typeof(DistanceTravelledPage));

                // Set the MainPage to be our Walks Navigation Page
                MainPage = walksPage;
            }
        }
コード例 #2
0
        public App()
        {
            // Check the Target OS Platform
            if (Device.OS == TargetPlatform.Android)
            {
                MainPage = new SplashPage();
            }
            else
            {
                // The root page of your application
                var walksPage = new NavigationPage(new WalksPage()
                {
                    Title = "Track My Walks"
                });

                var navService = DependencyService.Get <IWalkNavService>() as WalkNavService;

                navService.navigation = walksPage.Navigation;

                navService.RegisterViewMapping(typeof(WalksPageViewModel), typeof(WalksPage));
                navService.RegisterViewMapping(typeof(WalkEntryViewModel), typeof(WalkEntryPage));
                navService.RegisterViewMapping(typeof(WalksTrailViewModel), typeof(WalkTrailPage));
                navService.RegisterViewMapping(typeof(DistTravelledViewModel), typeof(DistanceTravelledPage));

                MainPage = walksPage;
            }
        }
コード例 #3
0
 protected override void OnStart()
 {
     // Check what Target OS Platform we are running on whenever the app starts
     if (Device.RuntimePlatform.Equals(Device.Android))
     {
         MainPage = new SplashPage();
     }
     else
     {
         // Set the root page for our application
         MainPage = new NavigationPage(new WalksMainPage());
     }
 }
コード例 #4
0
ファイル: App.xaml.cs プロジェクト: kekusss/TrackMyWalks
 public App()
 {
     if (Device.RuntimePlatform == Device.Android)
     {
         MainPage = new SplashPage();
     }
     else
     {
         var navPage = new NavigationPage(new TrackMyWalks.Pages.WalksPage()
         {
             Title = "Track My Walks"
         });
         MainPage = navPage;
     }
 }
コード例 #5
0
 public App()
 {
     // Check the Target OS Platform
     if (Device.OS == TargetPlatform.Android)
     {
         MainPage = new SplashPage();
     }
     else
     {
         // The root page of your application
         var navPage = new NavigationPage(new TrackMyWalks.WalksPage()
         {
             Title = "Track My Walks"
         });
         MainPage = navPage;
     }
 }
コード例 #6
0
        public App()
        {
            InitializeComponent();

            // Check the Target OS Platform
            if (Device.RuntimePlatform.Equals("Android"))
            {
                MainPage = new SplashPage();
            }
            else
            {
                // The root page of your application
                var navPage = new NavigationPage(new TrackMyWalks.Pages.WalksPage()
                {
                    Title = "Track My Walks"
                });
                MainPage = navPage;
            }
        }
コード例 #7
0
        public App()
        {
            InitializeComponent();

            // Check the Target OS Platform
            if (Device.RuntimePlatform == Device.iOS)
            {
                MainPage = new SplashPage();
            }
            else
            {
                // The root page of your application
                var navPage = new NavigationPage(new WalksPage())
                {
                    Title = "Track My Walks"
                };

                MainPage = navPage;
            }

            //MainPage = new TrackMyWalks.MainPage();
        }