While the normal way of event binding is by using attributes in the markup, I'd like to automatically event bind. This would be great when there is a large number of instances the component. In my case I'd like to always call a CascadingParameter component in the OnClick the same way.
Something like this:
public class PrositThBase : ComponentBase{ [Parameter] public RenderFragment ChildContent { get; set; } protected override async Task OnInitializedAsync() { OnClick += OnClick; base.OnInitializedAsync(); } public void OnClick() { }}
But this does not work. Is there any way of accomplishing this?