Blazor "auto-bindable" property source generator
anyone know lib that can auto generate required event and property?
For example:
Auto generate into:
???
8 Replies
You would have to put the attribute on a field instead.
You can't replace code so you wouldn't be able to transform
public bool Visible { get; set; }
into something else
wait nvmhmm it's fine, but do you know lib that can do it for me?
As you can see, it is a lot of boilerplate
You could try CommunityToolkit.Mvvm
CommunityToolkit.Mvvm
does exactly this, I believe the attribute is called ObservableProperty
https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/overview
this is what it generates for
let's code it myself
Should not be that hard
Look up how the mvvm lib is written, it's open source.