Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add first class support for onclick and other event handlers #503
What is it?
We're doing some tweaks to the ways that event handlers get wired to DOM events in Blazor, and adding a lot more features and power.
Hooking up a C# function to a handle a DOM event will look like:
or if you'd prefer a lambda:
This has first class integration with the editor in Visual Studio and will include tooltips and completion.
Passing in a string like
This kind of thing has been possible today using a few temporary syntaxes that will be removed as part of 0.2. Namely
Along with this change we'll be defining more of the standard DOM events with first class completion and eventargs types.
We'll also be adding support for arbitrary event names. So
I should have been more specific. How would the eventhandler be looking like in code/@functions, are the arguments going to be added the handler, is it params argument type, etc
Yes, it's like this: