public App(AppSetup setup) { AppContainer.Container = setup.CreateContainer(); InitializeComponent(); MainPage = new MainPage(); }
public App(AppSetup setup) { InitializeComponent(); AppContainer.Container = setup.CreateContainer(); InitializeNavigation(); }
public App(AppSetup setup) { AppContainer.Container = setup.CreateContainer(); InitializeComponent(); MainPage = new NavigationPage(new MainPageView()); }
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()); }
public App() { //InitializeComponent(); var appSetup = new AppSetup(); AppContainer.Container = appSetup.CreateContainer(); var navigationService = AppContainer.Container.Resolve <INavigationService>(); navigationService.InitializeAsync(); }
public App(AppSetup appSetup) { Ensure.ArgumentNotNull(appSetup, nameof(appSetup)); InitializeComponent(); Dependencies.Container = appSetup.CreateContainer(); MainPage = new MainPage(); }
public App() { InitializeComponent(); //To initialize Containers.. AppSetup appSetup = new AppSetup(); _container = appSetup.CreateContainer(); MainPage = new Views.Health.EpicrisisReport(); }
public App(AppSetup setup) { app = this; //This registers the dependences for Autofac AppContainer.Container = setup.CreateContainer(); Setup(); ShowLandingScreen(); }
public App(AppSetup setup) { InitializeComponent(); AppContainer.Container = setup.CreateContainer(); #if DEBUG HotReloader.Current.Run(this); #endif MainPage = new NavigationPage(new Views.IntroductionPage()); }
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(); }
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); }
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); } }
/// <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(); }
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(); }
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 }
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; }
/// <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}"); } }
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); } }
public App(AppSetup setup) { InitializeComponent(); AppContainer.Container = setup.CreateContainer(); MainPage = new AppShell(); }