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>
You are invoking it deconstructed:
await NewDayScrolledIntoView.InvokeAsync((p1, p2, p3));
When the event is received deconstruct it then:
<ShiftCardScroller NewDayScrolledIntoView="@((args)=> NewDayInView(args.Item1,args.Item2,args.Item3))" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With