Type of issue
Missing information
Description
I came across a hidden feature with data binding that I could not find anywhere in the documentation. If you have a public parameter of type string for example you can add a {PARAMETER NAME}Expression property and this property will be filled with the actual expression of the bound property. I think this detail is missing from the documentation and comes in handy for people who author their own input controls.
[Parameter] public string? Text { get; set; }
[Parameter] public EventCallback<string?> TextChanged { get; set; }
[Parameter] public Expression<Func<string?>>? TextExpression { get; set; } // undocumented feature
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-7.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/data-binding.md
Version Independent Document ID
3f912dfc-5ba5-6c6c-ba93-1ae78508a5cc
Article author
guardrex
Type of issue
Missing information
Description
I came across a hidden feature with data binding that I could not find anywhere in the documentation. If you have a public parameter of type string for example you can add a {PARAMETER NAME}Expression property and this property will be filled with the actual expression of the bound property. I think this detail is missing from the documentation and comes in handy for people who author their own input controls.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/data-binding?view=aspnetcore-7.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/data-binding.md
Version Independent Document ID
3f912dfc-5ba5-6c6c-ba93-1ae78508a5cc
Article author
guardrex