Exemplo n.º 1
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     base.BuildRenderTree(builder);
     builder?.OpenElement(0, TagName);
     builder.AddMultipleAttributes(1, MyParams);
     builder.AddContent(3, ChildContent);
     builder.AddElementReferenceCapture(2, capturedRef =>
     {
         ElementRef = capturedRef;
         ElementRefChanged?.Invoke(ElementRef); // Invoke the callback for the binding to work.
     });
     builder.CloseElement();
 }
Exemplo n.º 2
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            base.BuildRenderTree(builder);

            var seq = 0;

            builder.OpenElement(seq++, Tag);
            builder.AddMultipleAttributes(seq++, UnmatchedParameters);
            builder.AddElementReferenceCapture(seq++, reference =>
            {
                ElementRef = reference;
                ElementRefChanged?.Invoke(ElementRef);
            });
            builder.AddContent(seq++, ChildContent);
            builder.CloseElement();
        }
Exemplo n.º 3
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            builder.OpenElement(0, ElementName);

            builder.AddAttribute(1, "onclick", InvokeOnClickAsync);
            builder.AddEventPreventDefaultAttribute(2, "onclick", OnClickPreventDefault);
            builder.AddEventStopPropagationAttribute(3, "onclick", OnClickStopPropagation);
            builder.AddMultipleAttributes(4, AdditionalAttributes);
            builder.AddElementReferenceCapture(5, capturedRef =>
            {
                ElementRef = capturedRef;
                ElementRefChanged?.Invoke(ElementRef);
            });
            builder.AddContent(6, ChildContent);

            builder.CloseElement();
        }
Exemplo n.º 4
0
        /// <inheritdoc/>
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            base.BuildRenderTree(builder);
            builder?.OpenElement(0, TagName);

            builder.AddMultipleAttributes(1, Attributes);
            builder.AddEventPreventDefaultAttribute(2, "onclick", ClickPreventDefault);
            builder.AddEventStopPropagationAttribute(3, "onclick", ClickStopPropagation);
            builder.AddContent(4, ChildContent);
            builder.AddElementReferenceCapture(2, capturedRef =>
            {
                ElementRef = capturedRef;
                ElementRefChanged?.Invoke(ElementRef);   // Invoke the callback for the binding to work.
            });

            builder.CloseElement();
        }