Example #1
0
        private void RegisterDependencies(IDependencyInjectionService dependencyInjectionService, INavigation navigation, IEnumerable <IInstaller> installers = null)
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton(dependencyInjectionService);
            serviceCollection.AddSingleton(navigation);

            var blMobileInstaller = new BLMobileInstaller();

            blMobileInstaller.Install(serviceCollection);

            var mobileInstaller = new MobileInstaller();

            mobileInstaller.Install(serviceCollection);

            if (installers != null)
            {
                foreach (var installer in installers)
                {
                    installer.Install(serviceCollection);
                }
            }

            dependencyInjectionService.Build(serviceCollection);
        }
Example #2
0
 public App()
 {
     InitializeComponent();
     MainPage  = new LoginPage();
     DIService = new DI.DependencyInjectionService();
     RegisterDependencies();
     DIService.Build();
 }