Aspnetcore: How to expose multiple-argument event with EventCallback?

Created on 20 Jun 2020  路  2Comments  路  Source: dotnet/aspnetcore

The current EventCallback only allows a single argument via EventCallback<TArgs>. Sometimes, I need to expose events with some arguments. For example, EventCallback<MouseEventArgs,Foo>.

As I am new to Blazor, it maybe my ignorance. Is there such a feature available? Or should it be the next feature that I can request?

Answered Resolved area-blazor question

All 2 comments

The standard is to create a class that holds all of the values you wish to pass on. Just like the. NET standard EventArgs approach.

@pstricks-fans thanks for contacting us. @mrpmorris answer is correct.

Create a type for your event handler and add the properties there.

Was this page helpful?
0 / 5 - 0 ratings