protected override void BuildRenderTree(RenderTreeBuilder builder) { BuildBulma(); if (!CombinedAdditionalAttributes.ContainsKey("type")) { CombinedAdditionalAttributes.Add("type", "password"); } builder.OpenElement(0, "div"); builder.AddAttribute(1, "class", WrapperClassBuilder.ClassString); builder.OpenComponent <InputText>(2); builder.AddAttribute(3, "Value", Value); builder.AddAttribute(4, "ValueExpression", ValueExpression); builder.AddAttribute(5, "ValueChanged", ValueChanged); builder.AddAttribute(6, "AdditionalAttributes", CombinedAdditionalAttributes); builder.CloseComponent(); if (BulIcons != null) { builder.AddContent(7, BulIcons); } builder.CloseElement(); }
protected override void BuildRenderTree(RenderTreeBuilder builder) { BuildBulma(); string id = String.Empty; if (AdditionalAttributes.ContainsKey("id")) { id = AdditionalAttributes["id"].ToString(); } else { id = Guid.NewGuid().ToString(); CombinedAdditionalAttributes.Add("id", id); } CombinedAdditionalAttributes.Add("type", "checkbox"); builder.OpenElement(0, "div"); builder.AddAttribute(1, "class", "field"); builder.OpenComponent <InputCheckbox>(1); //builder.AddAttribute(2, "class", InputClassBuilder.ClassString); //builder.AddAttribute(2, "type", "checkbox"); builder.AddAttribute(3, "Value", Value); builder.AddAttribute(4, "ValueExpression", ValueExpression); builder.AddAttribute(5, "ValueChanged", ValueChanged); builder.AddAttribute(6, "AdditionalAttributes", CombinedAdditionalAttributes); builder.CloseComponent(); builder.OpenElement(7, "label"); builder.AddAttribute(8, "for", id); builder.AddContent(9, Label); builder.CloseElement(); builder.CloseElement(); }