C#C
C#3y ago
14 replies
CrosRoad95

Blazor "auto-bindable" property source generator

anyone know lib that can auto generate required event and property?

For example:

  [BindableParameter]
  public bool Visible { get; set; }


Auto generate into:
    private bool _visible;

    [Parameter]
    public bool Visible
    {
        get => _visible;
        set
        {
            if (_visible == value) return;

            _visible = value;
            VisibleChanged.InvokeAsync(value);
        }
    }
    [Parameter]
    public EventCallback<bool> VisibleChanged { get; set; }

???
Was this page helpful?