Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor EventCallback with Multiple Params - how to respond to event in parent host control

$
0
0

I have a blazor component with an EventCallBack parameter that utilized the new struct format allowing multiple arguments

[Parameter] public EventCallback<(EmployeeShiftDay, DateTime, DateTime)> NewDayScrolledIntoView { get; set; }

eventcallback is invoked in child normally as such

await NewDayScrolledIntoView.InvokeAsync(p1, p2, p3);

In my host page I have the corresponding method to handle the invoke

private void NewDayInView(EmployeeShiftDay dayInView, DateTime weekStart, DateTime weekEnd){   ...}

How do I add the markup for this EventCallBack in the host component - I need of course 3 params not just one

<ShiftCardScroller NewDayScrolledIntoView="@((args) => NewDayInView(args))" ></ShiftCardScroller>

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>