Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        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());
        }