ReactiveUI
ReactiveUI copied to clipboard
[Feature] Roslyn Source Generators
I'm thinking about creating a source generator for the ReactiveUI project, similar to the CommunityToolkit.Mvvm.SourceGenerators.
My ideas are the following:
ReactiveUI Property Source Generator
[ReactiveProperty]
private DateTime _time;
Generates:
public DateTime Time
{
get => _time;
private set => this.RaiseAndSetIfChanged(ref _time, value);
}
Observable As Property Helper Source Generator
[OaphProperty]
private readonly ObservableAsPropertyHelper<string> _text;
Generates:
public string Text => _text.Value;
I'm also considering that only the [ReactiveProperty] should be used and generate the appropriate property based on the type.
DinamicData Property Source Generator
[BindingProperty]
private readonly ReadOnlyObservableCollection<TrackViewModel> _tracks;
Generates:
public ReadOnlyObservableCollection<TrackViewModel> InboundTracks => _tracks;
Any idea?