示例#1
0
        /// <summary>
        /// Adds a bootstrap providers and component mappings.
        /// </summary>
        /// <param name="serviceCollection"></param>
        /// <returns></returns>
        public static IServiceCollection AddBootstrapProviders(this IServiceCollection serviceCollection)
        {
            serviceCollection.AddSingleton <IClassProvider, BootstrapClassProvider>();
            serviceCollection.AddSingleton <IStyleProvider, BootstrapStyleProvider>();
            serviceCollection.AddSingleton <IJSRunner, JSRunner>();

            var componentMapper = new ComponentMapper();

            componentMapper.Register <Blazorise.Addon, Bootstrap.Addon>();
            //componentMapper.Register<Blazorise.Addons, Bootstrap.Addons>();
            componentMapper.Register <Blazorise.BarToggler, Bootstrap.BarToggler>();
            componentMapper.Register <Blazorise.CardSubtitle, Bootstrap.CardSubtitle>();
            componentMapper.Register <Blazorise.CloseButton, Bootstrap.CloseButton>();
            componentMapper.Register <Blazorise.CheckEdit, Bootstrap.CheckEdit>();
            //componentMapper.Register<Blazorise.DateEdit, Bootstrap.DateEdit>();
            componentMapper.Register <Blazorise.Field, Bootstrap.Field>();
            componentMapper.Register <Blazorise.FieldBody, Bootstrap.FieldBody>();
            componentMapper.Register <Blazorise.FileEdit, Bootstrap.FileEdit>();
            componentMapper.Register <Blazorise.ModalContent, Bootstrap.ModalContent>();
            //componentMapper.Register<Blazorise.MemoEdit, Bootstrap.MemoEdit>();
            //componentMapper.Register<Blazorise.SelectEdit, Bootstrap.SelectEdit>();
            componentMapper.Register <Blazorise.SimpleButton, Bootstrap.SimpleButton>();
            //componentMapper.Register<Blazorise.TextEdit, Bootstrap.TextEdit>();

            serviceCollection.AddSingleton <IComponentMapper>(componentMapper);

            return(serviceCollection);
        }
示例#2
0
        public static IServiceCollection AddBulmaProviders(this IServiceCollection serviceCollection)
        {
            serviceCollection.AddSingleton <IClassProvider, BulmaClassProvider>();
            serviceCollection.AddSingleton <IStyleProvider, BulmaStyleProvider>();
            serviceCollection.AddSingleton <IJSRunner, JSRunner>();

            var componentMapper = new ComponentMapper();

            componentMapper.Register <Blazorise.Addons, Bulma.Addons>();
            componentMapper.Register <Blazorise.BarToggler, Bulma.BarToggler>();
            componentMapper.Register <Blazorise.Breadcrumb, Bulma.Breadcrumb>();
            componentMapper.Register <Blazorise.BreadcrumbLink, Bulma.BreadcrumbLink>();
            componentMapper.Register <Blazorise.CardImage, Bulma.CardImage>();
            componentMapper.Register <Blazorise.CardSubtitle, Bulma.CardSubtitle>();
            componentMapper.Register <Blazorise.CheckEdit, Bulma.CheckEdit>();
            componentMapper.Register <Blazorise.DateEdit, Bulma.DateEdit>();
            componentMapper.Register <Blazorise.DropdownDivider, Bulma.DropdownDivider>();
            componentMapper.Register <Blazorise.DropdownMenu, Bulma.DropdownMenu>();
            componentMapper.Register <Blazorise.DropdownToggle, Bulma.DropdownToggle>();
            componentMapper.Register <Blazorise.Field, Bulma.Field>();
            componentMapper.Register <Blazorise.FieldLabel, Bulma.FieldLabel>();
            componentMapper.Register <Blazorise.FieldHelp, Bulma.FieldHelp>();
            componentMapper.Register <Blazorise.FieldBody, Bulma.FieldBody>();
            componentMapper.Register <Blazorise.Fields, Bulma.Fields>();
            componentMapper.Register <Blazorise.FileEdit, Bulma.FileEdit>();
            componentMapper.Register <Blazorise.MemoEdit, Bulma.MemoEdit>();
            componentMapper.Register <Blazorise.SelectEdit, Bulma.SelectEdit>();
            componentMapper.Register <Blazorise.SimpleButton, Bulma.SimpleButton>();
            componentMapper.Register <Blazorise.Tabs, Bulma.Tabs>();
            componentMapper.Register <Blazorise.TextEdit, Bulma.TextEdit>();

            serviceCollection.AddSingleton <IComponentMapper>(componentMapper);

            return(serviceCollection);
        }