public override RenderFragment Render() => builder => { int seq = -1; BitBuilder.OpenElement(builder, ref seq, "div", this, LocalStyle(), null); BitBuilder.CloseElement(builder); };
public override RenderFragment Render() => builder => { int seq = -1; BitBuilder.OpenElement(builder, ref seq, "div", this, null, null); builder.AddContent(++seq, "тоЮ"); BitBuilder.CloseElement(builder); };
public override RenderFragment Render() => builder => { int seq = -1; BitBuilder.OpenElement(builder, ref seq, _element, this, null, null); builder.AddContent(++seq, Spec.Content !.Invoke().Fragment); BitBuilder.CloseElement(builder); };
public override RenderFragment Render() => builder => { int seq = -1; BitBuilder.OpenElement(builder, ref seq, "button", this, null, LocalClasses()); builder.AddAttribute(++seq, "onclick", EventCallback.Factory.Create <MouseEventArgs>(this, Click)); builder.AddContent(++seq, Spec.Content !.Invoke().Fragment); BitBuilder.CloseElement(builder); };
protected override void BuildRenderTree(RenderTreeBuilder builder) { int seq = -1; BitBuilder.OpenElement(builder, ref seq, "div", Checkbox, null, Checkbox.AdditionalClasses()); builder.AddAttribute(++seq, "onclick", EventCallback.Factory.Create <MouseEventArgs>(this, Checkbox.OnClick)); builder.OpenComponent <MaterialIcon>(++seq); builder.AddAttribute(++seq, "ID", !Checkbox.Checked ? "check_box_outline_blank" : "check_box"); builder.CloseComponent(); BitBuilder.CloseElement(builder); }
public override RenderFragment Render() => builder => { int seq = -1; // Define these in HTML instead of CSS. double?height = _pixelsHeight?.Invoke() ?? null; double?width = _pixelsWidth?.Invoke() ?? null; BitBuilder.OpenElement(builder, ref seq, "img", this, null, null); builder.AddAttribute(++seq, "src", Spec.URL !.Invoke()); builder.AddAttribute(++seq, "height", height); builder.AddAttribute(++seq, "width", width); BitBuilder.CloseElement(builder); };
public override RenderFragment Render() => builder => { int seq = -1; if (Spec.URL == null) { BitBuilder.OpenElement(builder, ref seq, "div", this, null, null); } else { BitBuilder.OpenElement(builder, ref seq, "a", this, null, null); builder.AddAttribute(++seq, "href", Spec.URL.Invoke()); } builder.AddContent(++seq, Spec.Content !.Invoke().Fragment); BitBuilder.CloseElement(builder); };
// From: // https://codepen.io/jczimm/pen/vEBpoL public override RenderFragment Render() => builder => { int seq = -1; // Define this in HTML instead of CSS. double size = _pixelsSize?.Invoke() ?? 64; string color = _color?.Invoke() ?? Constants.Accent_4; double thickness = _thickness?.Invoke() ?? 4; BitBuilder.OpenElement(builder, ref seq, "div", this, null, null); builder.OpenElement(++seq, "svg"); builder.AddAttribute(++seq, "height", size); builder.AddAttribute(++seq, "width", size); builder.AddAttribute(++seq, "viewBox", $"0 0 100 100"); // builder.AddMarkupContent(++seq, $"<circle " + $"cx='50' " + $"cy='50' " + $"r='40' " + $"fill='none' " + // $"stroke-dasharray='200, 400' " + $"stroke-dashoffset='0' " + $"stroke-linecap='round' " + $"stroke-width='{thickness}' " + $"stroke='{color}'" + $"/>"); // builder.CloseElement(); BitBuilder.CloseElement(builder); };