public void ConfigureContainer(ResolverConfig config) { config.UseDataAccessor(); config.BindSingleton <IDbProvider>(new DelegateDbProvider(() => new SqliteConnection("Data Source=test.db"))); config.BindSingleton <SmartMetrics>(); }
private SmartResolver CreateResolver(IComponentProvider provider) { var config = new ResolverConfig() .UseAutoBinding() .UseArrayBinding() .UseAssignableBinding() .UsePropertyInjector() .UsePageContextScope(); config.UseXamarinFormsComponents(adapter => { adapter.AddDialogs(); adapter.AddPopupNavigator(); adapter.AddJsonSerializer(); adapter.AddSettings(); // Custom adapter.UsePopupPageFactory <PopupPageFactory>(); }); config.BindSingleton <INavigator>(_ => navigator); config.BindSingleton <ApplicationState>(); config.BindSingleton <Configuration>(); config.BindSingleton <Session>(); config.BindSingleton <IAttachableBarcodeReader, AttachableEntryBarcodeReader>(); provider.RegisterComponents(config); return(config.ToResolver()); }
private SmartResolver CreateResolver(IComponentProvider provider) { var config = new ResolverConfig() .UseAutoBinding() .UseArrayBinding() .UseAssignableBinding() .UsePropertyInjector() .UsePageContextScope(); config.UseXamarinFormsComponents(adapter => { adapter.AddDialogs(); adapter.AddPopupNavigator(); adapter.AddJsonSerializer(); adapter.AddSettings(); }); config.BindSingleton <INavigator>(_ => navigator); config.BindSingleton <ApplicationState>(); config.BindSingleton <IMapper>(new Mapper(new MapperConfiguration(c => { c.AddProfile <MappingProfile>(); }))); config.BindSingleton <Configuration>(); config.BindSingleton <Session>(); config.BindSingleton(new DataServiceOptions { Path = Path.Combine(FileSystem.AppDataDirectory, "Mobile.db") }); config.BindSingleton <DataService>(); config.BindSingleton <NetworkService>(); config.BindSingleton <NetworkOperator>(); config.BindSingleton <SampleUsecase>(); provider.RegisterComponents(config); return(config.ToResolver()); }
private static SmartResolver CreateResolver() { var config = new ResolverConfig() .UseAutoBinding() .UseArrayBinding() .UseAssignableBinding() .UsePropertyInjector(); config.UseXamarinFormsComponents(adapter => { adapter.AddDialogs(); }); config.BindSingleton(new DataServiceOptions { Path = Path.Combine(FileSystem.AppDataDirectory, "Mobile.db") }); config.BindSingleton <DataService>(); return(config.ToResolver()); }
private SmartResolver CreateResolver() { var config = new ResolverConfig() .UseAutoBinding() .UseArrayBinding() .UseAssignableBinding() .UsePropertyInjector() .UsePageContextScope(); config.UseXamarinFormsComponents(adapter => { adapter.AddDialogs(); adapter.AddPopupNavigator(); }); config.BindSingleton <INavigator>(_ => navigator); config.BindSingleton <ApplicationState>(); config.BindSingleton <DataService>(); return(config.ToResolver()); }