Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:SigobMobile.App"/> class.
        /// </summary>
        public App()
        {
            InitializeComponent();
            //Settings.Token = Settings.DbToken = Settings.InstitutionLogo =  string.Empty;
            if (string.IsNullOrEmpty(Settings.Token))
            {
                var navPage = new Xamarin.Forms.NavigationPage(new LoginPage());
                navPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);
                navPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetLargeTitleDisplay(LargeTitleDisplayMode.Automatic);
                this.MainPage = navPage;
            }
            else
            {
                var mainViewModel = MainViewModel.GetInstance();

                mainViewModel.Token   = Settings.Token;
                mainViewModel.DbToken = Settings.DbToken;

                //Load Master Detail with ApplicationsPage
                mainViewModel.Menu         = new MenuViewModel();
                mainViewModel.Applications = new ApplicationsViewModel()
                {
                    IsRefreshing = false
                };
                var mainSigobPage = new MasterDetailSigobPage();
                //NavigatePage properties IphoneX
                Xamarin.Forms.NavigationPage navDetailPage = (Xamarin.Forms.NavigationPage)mainSigobPage.Detail;
                navDetailPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(false);
                navDetailPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetLargeTitleDisplay(LargeTitleDisplayMode.Never);
                Xamarin.Forms.Application.Current.MainPage = mainSigobPage;
            }
        }
Beispiel #2
0
        public App()
        {
            var accelerometerPage      = new AccelerometerPage();
            var gyroscopePage          = new GyroscopePage();
            var settingsNavigationPage = new Xamarin.Forms.NavigationPage(new SettingsPage())
            {
                Icon  = "Settings",
                Title = "Settings",
                BarBackgroundColor = Xamarin.Forms.Color.White,
                BarTextColor       = Xamarin.Forms.Color.Black
            };

            settingsNavigationPage.On <iOS>().SetPrefersLargeTitles(true);

            var tabbedPage = new Xamarin.Forms.TabbedPage
            {
                Children =
                {
                    accelerometerPage,
                    gyroscopePage,
                    settingsNavigationPage
                }
            };

            tabbedPage.On <Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);

            MainPage = tabbedPage;
        }
Beispiel #3
0
        public App()
        {
            InitializeComponent();

            var navigationPage = new Xamarin.Forms.NavigationPage(new Views.Clientes.ListagemView());

            navigationPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);
            //MainPage = navigationPage;
            MainPage = new MainPageView();
        }
Beispiel #4
0
        /// <summary>
        /// Navigate to Detail Page selected in MenuPage
        /// </summary>
        private async Task Navigate()
        {
            App.Master.IsPresented = false;
            var mainViewModel = MainViewModel.GetInstance();
            await App.Navigator.PopToRootAsync(false);

            switch (this.PageName)
            {
            case "SecurityPage":
                mainViewModel.Security = new SecurityViewModel();
                await App.Navigator.PushAsync(new SecurityPage(), true);

                break;

            case "WebViewHelpPage":
            case "WebViewTermsPage":
            case "WebViewContactPage":
                mainViewModel.UrlViewer = new UrlViewerViewModel(this.Url);
                await App.Navigator.PushAsync(new UrlViewerPage()
                {
                    Title = this.Title
                }, true);

                break;

            case "LoginPage":
                //Delete persist token values
                Settings.Token      = Settings.DbToken = Settings.InstitutionLogo = Settings.FullName = Settings.OfficeCode = string.Empty;
                mainViewModel.Token = mainViewModel.DbToken = string.Empty;
                //Navigate to Login
                mainViewModel.Login = new LoginViewModel();
                var navLoginPage = new Xamarin.Forms.NavigationPage(new LoginPage());
                navLoginPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);
                navLoginPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetLargeTitleDisplay(LargeTitleDisplayMode.Automatic);
                Xamarin.Forms.Application.Current.MainPage = navLoginPage;
                break;

            default:
                break;
            }
        }
Beispiel #5
0
        public App()
        {
            var navigationPage = new Xamarin.Forms.NavigationPage(new NewsPage())
            {
                BarBackgroundColor = ColorConstants.NavigationBarBackgroundColor,
                BarTextColor       = ColorConstants.NavigationBarTextColor
            };

            navigationPage.On <iOS>().SetPrefersLargeTitles(true);

            MainPage = navigationPage;
        }
        public App()
        {
            var navigationPage = new Xamarin.Forms.NavigationPage(new GraphQLPage())
            {
                BarBackgroundColor = Xamarin.Forms.Color.FromHex("#3498db"),
                BarTextColor       = Xamarin.Forms.Color.White
            };

            navigationPage.On <iOS>().SetPrefersLargeTitles(true);

            MainPage = navigationPage;
        }
Beispiel #7
0
        public App()
        {
            Xamarin.Forms.Device.SetFlags(new[] { "Markup_Experimental" });

            var navigationPage = new Xamarin.Forms.NavigationPage(new NewsPage())
            {
                BarBackgroundColor = ColorConstants.NavigationBarBackgroundColor,
                BarTextColor       = ColorConstants.NavigationBarTextColor
            };

            navigationPage.On <iOS>().SetPrefersLargeTitles(true);

            MainPage = navigationPage;
        }
Beispiel #8
0
        public App()
        {
            Xamarin.Forms.Device.SetFlags(new[] { "Markup_Experimental" });

            var navigationPage = new Xamarin.Forms.NavigationPage(new GraphQLPage())
            {
                BarBackgroundColor = Xamarin.Forms.Color.FromHex("#3498db"),
                BarTextColor       = Xamarin.Forms.Color.White
            };

            navigationPage.On <iOS>().SetPrefersLargeTitles(true);

            MainPage = navigationPage;
        }
Beispiel #9
0
        public App()
        {
            InitializeComponent();

            //            var page = new NavigationPageClientesViews();
            //            page.On<Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true);
            //            MainPage = new Xamarin.Forms.NavigationPage(new NavigationPageClientesView()); ;

            var navigationPage = new Xamarin.Forms.NavigationPage(new MasterDetailPageView());

            navigationPage.On <Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);
            navigationPage.BarBackgroundColor = Color.Red;
            navigationPage.BarTextColor       = Color.White;

            MainPage = navigationPage;
        }
Beispiel #10
0
        public App(RestApiStatusPage restApiStatusPage, GraphQLApiStatusPage graphQLApiStatusPage)
        {
            var restStatusNavigationPage = new Xamarin.Forms.NavigationPage(restApiStatusPage);

            restStatusNavigationPage.On <iOS>().SetPrefersLargeTitles(true);

            var graphQLStatusNavigationPage = new Xamarin.Forms.NavigationPage(graphQLApiStatusPage);

            graphQLStatusNavigationPage.On <iOS>().SetPrefersLargeTitles(true);

            var tabbedPage = new Xamarin.Forms.TabbedPage
            {
                Children =
                {
                    restApiStatusPage,
                    graphQLApiStatusPage
                }
            };

            tabbedPage.On <Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);

            MainPage = tabbedPage;
        }