Exemple #1
0
        public static IServiceCollection AddMaterialProviders(this IServiceCollection serviceCollection, Action <IClassProvider> configureClassProvider = null)
        {
            var classProvider = new MaterialClassProvider();

            configureClassProvider?.Invoke(classProvider);

            serviceCollection.AddSingleton <IClassProvider>(classProvider);
            serviceCollection.AddSingleton <IStyleProvider, MaterialStyleProvider>();
            serviceCollection.AddScoped <IJSRunner, MaterialJSRunner>();
            serviceCollection.AddSingleton <IComponentMapper, ComponentMapper>();

            return(serviceCollection);
        }
Exemple #2
0
        public static IServiceCollection AddMaterialProviders(this IServiceCollection serviceCollection, Action <IClassProvider> configureClassProvider = null)
        {
            var classProvider = new MaterialClassProvider();

            configureClassProvider?.Invoke(classProvider);

            serviceCollection.AddSingleton <IClassProvider>(classProvider);
            serviceCollection.AddSingleton <IStyleProvider, MaterialStyleProvider>();
            serviceCollection.AddScoped <IJSRunner, MaterialJSRunner>();
            serviceCollection.AddScoped <IThemeGenerator, MaterialThemeGenerator>();

            foreach (var mapping in ComponentMap)
            {
                serviceCollection.AddTransient(mapping.Key, mapping.Value);
            }

            return(serviceCollection);
        }
Exemple #3
0
        public static IServiceCollection AddMaterialProviders(this IServiceCollection serviceCollection, Action <IClassProvider> configureClassProvider = null)
        {
            var classProvider = new MaterialClassProvider();

            configureClassProvider?.Invoke(classProvider);

            serviceCollection.AddSingleton <IClassProvider>(classProvider);
            serviceCollection.AddSingleton <IStyleProvider, MaterialStyleProvider>();
            serviceCollection.AddScoped <IJSRunner, MaterialJSRunner>();
            serviceCollection.AddScoped <IThemeGenerator, MaterialThemeGenerator>();

            serviceCollection.AddBootstrapComponents();

            // material overrides
            serviceCollection.AddTransient(typeof(Blazorise.Switch <>), typeof(Material.Switch <>));
            serviceCollection.AddTransient <Blazorise.Step, Material.Step>();
            serviceCollection.AddTransient <Blazorise.Steps, Material.Steps>();

            return(serviceCollection);
        }