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>() // ; }
// 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); }
private async Task InitializeAsync() { ConsoleHelper.PrintHeader(); var serviceProvider = await ServicesInitializer.InitializeAsync(); serviceProvider.InitAllSingletons(); await serviceProvider.GetRequiredService <IModulesHandler>().LoadModules(); await Task.Delay(-1); }
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); }
public void Setup() => ServicesInitializer.ConfigureMappings();