-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streamline delegate-typed component parameters #16380
Labels
area-blazor
Includes: Blazor, Razor Components
Comments
rynowak
referenced
this issue
in dotnet/blazor
Mar 21, 2018
This change removes the magic 'auto-lambda' feature that has some unconvincing UX. Also working around a razor bug where explicit expressions are lowered incorrectly. This should make it possible to write code like: <Foo Bar="@(e => { OnChanged(e); })" />
rynowak
referenced
this issue
in dotnet/blazor
Mar 21, 2018
This change removes the magic 'auto-lambda' feature that has some unconvincing UX. Also working around a razor bug where explicit expressions are lowered incorrectly. This should make it possible to write code like: <Foo Bar="@(e => { OnChanged(e); })" />
SteveSandersonMS
referenced
this issue
in dotnet/blazor
Mar 21, 2018
This change removes the magic 'auto-lambda' feature that has some unconvincing UX. Also working around a razor bug where explicit expressions are lowered incorrectly. This should make it possible to write code like: <Foo Bar="@(e => { OnChanged(e); })" />
Fixed in dotnet/blazor#321 |
SteveSandersonMS
referenced
this issue
in SteveSandersonMS/BlazorMigration
Nov 27, 2018
This change removes the magic 'auto-lambda' feature that has some unconvincing UX. Also working around a razor bug where explicit expressions are lowered incorrectly. This should make it possible to write code like: <Foo Bar="@(e => { OnChanged(e); })" />
ghost
locked as resolved and limited conversation to collaborators
Dec 4, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As discussed:
End goal: ideally, all of the following should be equivalent for a parameter of type
Func<string, int>
:<MyComponent Callback="str => str.Length" />
<MyComponent Callback="@(str => str.Length)" />
<MyComponent Callback=@(str => str.Length) />
<MyComponent Callback=@((str) => { return str.Length; }) />
<MyComponent Callback=SomeMethod />
, givenint SomeMethod(string input) => input.Length;
<MyComponent Callback=@SomeMethod />
, givenint SomeMethod(string input) => input.Length;
<MyComponent Callback=@(SomeMethod) />
, givenint SomeMethod(string input) => input.Length;
That's just out of my head, though, and there may be reasons why some subset of these shouldn't be supported (or it's too disruptive to support them in the very short term).
The text was updated successfully, but these errors were encountered: