Beispiel #1
0
        protected override void RegisterTypes()
        {
            base.RegisterTypes();

            ServicesInitializer.Init(Container);
            ViewModelInitializer.Init(Container);

            Container
            // Regions.
            .RegisterSingleton <HomeRegion>()
            .RegisterSingleton <ConfigurationRegion>()
            .RegisterSingleton <PlayingRegion>()
            .RegisterSingleton <PreStartRegion>()
            .RegisterSingleton <ConfigurationListRegion>()

            // Backgrounds.
            .RegisterSingleton <HomeBackground>()
            .RegisterSingleton <PreStartBackground>()
            .RegisterSingleton <ConfigurationBackground>()
            .RegisterSingleton <PlayingBackground>()
            .RegisterSingleton <ConfigurationListBackground>()

            // Dialogs.
            .RegisterType <IDialogFor <SelectRaceDialogViewModel>, SelectRaceDialog>()
            .RegisterType <IDialogFor <SelectCounselorDialogViewModel>, SelectCounselorDialog>()

            //
            ;
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            ContextInitializer.Init(services, Configuration);

            BrokerInitializer.Init(services, Configuration);

            ServicesInitializer.Init(services, Configuration);
        }
Beispiel #3
0
        private async Task InitializeAsync()
        {
            ConsoleHelper.PrintHeader();
            var serviceProvider = await ServicesInitializer.InitializeAsync();

            serviceProvider.InitAllSingletons();

            await serviceProvider.GetRequiredService <IModulesHandler>().LoadModules();

            await Task.Delay(-1);
        }
Beispiel #4
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation <NavigationPage>();
            containerRegistry.RegisterForNavigation <StartHerePage, StartHerePageViewModel>();
            containerRegistry.RegisterForNavigation <ManualPage, ManualPageViewModel>();
            containerRegistry.RegisterForNavigation <WikiPage, WikiPageViewModel>();

            containerRegistry.RegisterSingleton <ISettingService, SettingService>();
            containerRegistry.RegisterSingleton <IUserDialogService, UserDialogService>();
            containerRegistry.RegisterSingleton <IPlaySoundService, PlaySoundService>();

            ServicesInitializer.Initialize(containerRegistry, Container);
        }
Beispiel #5
0
 public void Setup() => ServicesInitializer.ConfigureMappings();