예제 #1
0
        public App(AppSetup setup)
        {
            AppContainer.Container = setup.CreateContainer();

            InitializeComponent();

            MainPage = new MainPage();
        }
예제 #2
0
        public App(AppSetup setup)
        {
            InitializeComponent();

            AppContainer.Container = setup.CreateContainer();

            InitializeNavigation();
        }
예제 #3
0
        public App(AppSetup setup)
        {
            AppContainer.Container = setup.CreateContainer();

            InitializeComponent();

            MainPage = new NavigationPage(new MainPageView());
        }
예제 #4
0
 public App(AppSetup setup)
 {
     AppContainer.Container = setup.CreateContainer();
     //  StartupConfig.EnsureDbCreated().ConfigureAwait(true).GetAwaiter().GetResult();
     //   StartupConfig.SeedDb().ConfigureAwait(true).GetAwaiter().GetResult();
     InitializeComponent();
     MainPage = new NavigationPage(new LoginPage());
 }
예제 #5
0
        public App()
        {
            //InitializeComponent();
            var appSetup = new AppSetup();

            AppContainer.Container = appSetup.CreateContainer();
            var navigationService = AppContainer.Container.Resolve <INavigationService>();

            navigationService.InitializeAsync();
        }
예제 #6
0
        public App(AppSetup appSetup)
        {
            Ensure.ArgumentNotNull(appSetup, nameof(appSetup));

            InitializeComponent();

            Dependencies.Container = appSetup.CreateContainer();

            MainPage = new MainPage();
        }
예제 #7
0
        public App()
        {
            InitializeComponent();

            //To initialize Containers..
            AppSetup appSetup = new AppSetup();

            _container = appSetup.CreateContainer();

            MainPage = new Views.Health.EpicrisisReport();
        }
예제 #8
0
        public App(AppSetup setup)
        {
            app = this;

            //This registers the dependences for Autofac
            AppContainer.Container = setup.CreateContainer();

            Setup();

            ShowLandingScreen();
        }
예제 #9
0
        public App(AppSetup setup)
        {
            InitializeComponent();

            AppContainer.Container = setup.CreateContainer();

#if DEBUG
            HotReloader.Current.Run(this);
#endif

            MainPage = new NavigationPage(new Views.IntroductionPage());
        }
예제 #10
0
파일: App.xaml.cs 프로젝트: kappsegla/App19
        public App(AppSetup setup)
        {
            InitializeComponent();
            // AppDomain.CurrentDomain.UnhandledException += (sender, args) => {
            //     System.Exception ex = (System.Exception)args.ExceptionObject;
            //     Console.WriteLine(ex);
            // };
            AppContainer.Container = setup.CreateContainer();

            //MainPage = new MainPage();
            //MainPage = new NavigationPage(new ItemsPage());
            //MainPage = new ValidationPage();
            //MainPage = new NavigationPage (new FirstPage());
            //MainPage = new AppShell();
            MainPage = new TemperaturePage();
        }
예제 #11
0
        public void CreateContainerRegistersAllViewModels()
        {
            var container = _appSetup.CreateContainer();

            var expectedType = typeof(IViewModel);
            var found        = 0;
            var assembly     = Assembly.Load("SqlSaturday");
            var types        = assembly.GetTypes()
                               .Where(t => expectedType.IsAssignableFrom(t) && t.IsClass && t != typeof(BaseViewModel));

            foreach (var type in types)
            {
                Assert.IsTrue(container.IsRegistered(type));
                found++;
            }

            Assert.AreNotEqual(found, 0);
        }
예제 #12
0
        public App(AppSetup appSetup)
        {
            try
            {
                IsUserLoggedIn = false;
                IsFormsAdded   = false;
                string checkSettings = String.Empty;

                // Create the Autofac IOC container.
                AppContainer.Container = appSetup.CreateContainer();


                // Determine if we have settings and / or if the user is logged in.

                if (checkSettings != "true")
                {
                    MainPage = new NavigationPage(new SettingsView())
                    {
                        BarBackgroundColor = Color.FromHex(AppStyle.BarBackGroundColor),
                        BarTextColor       = Color.FromHex(AppStyle.BarTextColor)
                    };

                    return;
                }

                if (!IsUserLoggedIn)
                {
                    MainPage = new NavigationPage(new LogViewMasters())
                    {
                        BarBackgroundColor = Color.FromHex(AppStyle.BarBackGroundColor),
                        BarTextColor       = Color.White
                    };
                }
                else
                {
                    MainPage = new NavigationPage(new MainViewsMasters());
                }
            }
            catch (Exception esx)
            {
                Debug.WriteLine(esx);
            }
        }
예제 #13
0
        /// <summary>
        /// Initializes the app.
        /// </summary>
        private void InitializeApp()
        {
            // Initialize SVG
            XamSvg.Setup.InitSvgLib();
            //Tells XamSvg in which assembly to search for svg when "res:" is used
            XamSvg.Shared.Config.ResourceAssembly = typeof(SVGImages).GetTypeInfo().Assembly;

            // If not required for your application you can safely delete this method
            var setup = new AppSetup();

            AppContainer.Container = setup.CreateContainer();
            setup.InitObjectMapping();

            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            var viewController = new LoginViewController();
            // Add the Navigation Controller and initialize it
            var navController = new UINavigationController(viewController);

            Window.RootViewController = navController;
            Window.MakeKeyAndVisible();
        }
예제 #14
0
        public App(AppSetup setup)
        {
            InitializeComponent();

            DependencyService.Register <MockDataStore>();
            AppContainer.Container = setup.CreateContainer();
            Application.Current.Properties["id"] = "";

            NavigationService.Configure("MainPage", typeof(Views.MainPage));
            NavigationService.Configure("AboutPage", typeof(Views.AboutPage));
            NavigationService.Configure("ItemDetailPage", typeof(Views.ItemDetailPage));
            NavigationService.Configure("ItemsPage", typeof(Views.ItemsPage));
            NavigationService.Configure("LoginPage", typeof(Views.LoginPage));
            NavigationService.Configure("MenuPage", typeof(Views.MenuPage));
            NavigationService.Configure("NewItemPage", typeof(Views.NewItemPage));
            NavigationService.Configure("SignUpPage", typeof(Views.SignUpPage));
            NavigationService.Configure("WelcomePage", typeof(Views.WelcomePage));
            var mainPage = ((NavigationService)NavigationService).SetRootPage("MainPage");

            MainPage = new MainPage();
        }
예제 #15
0
        public App()
        {
            InitializeComponent();
            //To initialize Containers..
            AppSetup appSetup = new AppSetup();

            _container = appSetup.CreateContainer();

            if (!string.IsNullOrEmpty(Helpers.LocalStorage.GeneralProfileToken))
            {
                MainPage = new Views.Currencies.CurrencyPage();
            }
            else
            {
                MainPage = new Views.Introduction.IntroductionPage();
            }

            #region
            Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("OTMyNDlAMzEzNzJlMzEyZTMwWVAxejJTOFhSaUswQm1MUGJoWC93K3pyRWpkdkNVM0oyemhkK1ZzY0pNbz0=");
            #endregion
        }
예제 #16
0
        public App(AppSetup setup)
        {
            InitializeComponent();

            var page    = new MainPageView();
            var navPage = new NavigationPage(page);

            _container = setup.CreateContainer(cb => {
                cb.RegisterInstance(navPage as Page);
                cb.RegisterInstance(this as Application);
            });

            _container.BeginLifetimeScope();

            setup.RegisterViewModelMappings();

            var vm = _container.Resolve <MainViewModelFactory>().Create();

            page.BindingContext = vm;

            MainPage = navPage;
        }
예제 #17
0
        /// <summary>Initializes a new instance of the <see cref="App"/> class. The IoC container is created
        /// and the app is kicked off.
        /// </summary>
        /// <param name="appSetup">The <see cref="Acs.Mobile.EFR.Configuration.AppSetup"/> that is responsible
        /// for facilitating the registration of the types for IoC.</param>
        public App(AppSetup appSetup)
        {
            try
            {
                IsFormsAdded = false;
                string checkSettings = String.Empty;
                checkSettings = Settings.Current.Get <string>("IsSettingsSaved");

                // Create the Autofac IOC container.
                AppContainer.Container = appSetup.CreateContainer();

                // Determine if we have settings and / or if the user is logged in.
                if (checkSettings != "true")
                {
                    MainPage = new NavigationPage(new SettingsView())
                    {
                        // this line was commented out in my work from yesterday.
                        // BarBackgroundColor = Color.FromHex(AppStyle.BarBackGroundColor),
                    };

                    return;
                }

                if (!IsUserLoggedIn)
                {
                    if (CrossDevice.Hardware.OperatingSystem == "WINDOWS")
                    {
                        MainPage = new NavigationPage(new MainViewsMasters())
                        {
                            // BarBackgroundColor = Color.FromHex(AppStyle.BarBackGroundColor),
                            // BarTextColor = Color.White
                        };
                    }
                    else
                    {
                        MainPage = new NavigationPage(new MainViewsMasters())
                        {
                            // BarBackgroundColor = Color.FromHex(AppStyle.BarBackGroundColor),
                            // BarTextColor = Color.White
                        };
                    }
                }
                else
                {
                    if (CrossDevice.Hardware.OperatingSystem == "WINDOWS")
                    {
                        MainPage = new NavigationPage(new MainViewsMasters())
                        {
                            // BarBackgroundColor = Color.FromHex(AppStyle.BarBackGroundColor),
                            // BarTextColor = Color.White
                        };
                    }
                    else
                    {
                        MainPage = new NavigationPage(new MainViewsMasters())
                        {
                            // BarBackgroundColor = Color.FromHex(AppStyle.BarBackGroundColor),
                            // BarTextColor = Color.White
                        };
                    }
                }
            }
            catch (Exception esx)
            {
                Debug.WriteLine($"EXCEPTION: {esx.Message}");
            }
        }
예제 #18
0
        public App(AppSetup appSetup)
        {
            // TODO: Dispose of AppSetup
            try
            {
                IsUserLoggedIn = false;
                IsFormsAdded   = false;

                string checkSettings = String.Empty;

                AppContainer.Container = appSetup.CreateContainer();

                //   checkSettings = DependencyService.Get<IUserPreferences>().GetString("IsSettingsSaved");

                if (checkSettings != "true")
                {
                    // MainPage = new NavigationPage(new Index())
                    MainPage = new NavigationPage(new SettingsView())
                    {
                        // TODO: refactor colors out to style resources in shared.
                        // Just as planned
                        BarBackgroundColor = Color.FromHex(AppStyle.barBackGroundColor),
                        BarTextColor       = Color.FromHex(AppStyle.barTextColor)
                    };

                    return;
                }

                if (!IsUserLoggedIn)
                {
                    // MainPage = new NavigationPage(new Index())

                    //DependencyService.Get<IUserPreferences>().GetString("SetVersion");

                    //Settings.SetAuthorizationToken(DependencyService.Get<IUserPreferences>().GetString("SetAuthorizationToken"));
                    //Settings.SetSerialNumber(DependencyService.Get<IUserPreferences>().GetString("SetSerialNumber"));
                    //Settings.SetDomainName(DependencyService.Get<IUserPreferences>().GetString("SetDomainName"));
                    //Settings.SetApplicationId(DependencyService.Get<IUserPreferences>().GetString("SetApplicationId"));
                    //Settings.SetVersion(DependencyService.Get<IUserPreferences>().GetString("SetVersion"));

                    MainPage = new NavigationPage(new LogViewMasters())
                    {
                        // TODO: refactor colors out to style resources in shared.
                        // Just as planned
                        BarBackgroundColor = Color.FromHex(AppStyle.barBackGroundColor),
                        BarTextColor       = Color.White
                    };
                }
                else
                {
                    //Settings.SetAuthorizationToken(DependencyService.Get<IUserPreferences>().GetString("SetAuthorizationToken"));
                    //Settings.SetSerialNumber(DependencyService.Get<IUserPreferences>().GetString("SetSerialNumber"));
                    //Settings.SetDomainName(DependencyService.Get<IUserPreferences>().GetString("SetDomainName"));
                    //Settings.SetApplicationId(DependencyService.Get<IUserPreferences>().GetString("SetApplicationId"));
                    //Settings.SetVersion(DependencyService.Get<IUserPreferences>().GetString("SetVersion"));


                    MainPage = new NavigationPage(new MainViewsMasters());
                    // MainPage = new NavigationPage(new Index());
                }
            }
            catch (Exception esx) {
                Debug.Write(esx);
            }
        }
예제 #19
0
 public App(AppSetup setup)
 {
     InitializeComponent();
     AppContainer.Container = setup.CreateContainer();
     MainPage = new AppShell();
 }