Example #1
0
        public IComponentBuilder <TComponent> ChildContent(Action <RenderFragmentBuilder> builderCallback)
        {
            var renderFragmentBuilder = new RenderFragmentBuilder();

            builderCallback(renderFragmentBuilder);
            _componentParameters.Add(
                ComponentParameter.CreateParameter(nameof(ChildContent), renderFragmentBuilder.ToRenderFragment())
                );
            return(this);
        }
Example #2
0
        public IComponentBuilder <TComponent> RenderFragment(
            Expression <Func <TComponent, RenderFragment> > expression,
            Action <RenderFragmentBuilder> renderFragmentBuilder
            )
        {
            var propertyName = GetPropertyName(expression);
            var builder      = new RenderFragmentBuilder();

            renderFragmentBuilder(builder);
            _componentParameters.Add(ComponentParameter.CreateParameter(propertyName, builder.ToRenderFragment()));
            return(this);
        }