Open martinbu opened 1 month ago
I will take a look at what would be required to achieve this My understanding is that you wish to be able to turn this.
private ReadOnlyObservableCollection<Person> _visiblePeople;
ctor()
{
this.WhenAnyValue(vm => vm.People)
.Subscribe(people => people
.ToObservableChangeSet()
.AutoRefresh(x => x.Deleteed)
.Filter(x => !x.Deleted)
.Bind(out _visiblePeople)
.Subscribe());
}
public ReadOnlyObservableCollection<Person> VisiblePeople => _visiblePeople;
Into this
[BindableDerivedList]
private ReadOnlyObservableCollection<Person> _visiblePeople;
ctor()
{
this.WhenAnyValue(vm => vm.People)
.Subscribe(people => people
.ToObservableChangeSet()
.AutoRefresh(x => x.Deleteed)
.Filter(x => !x.Deleted)
.Bind(out _visiblePeople)
.Subscribe());
}
Which will then generate
public ReadOnlyObservableCollection<Person> VisiblePeople => _visiblePeople;
Yes exactly! Thank you for looking into this.
I already started a discussion here some time ago. https://github.com/reactiveui/ReactiveUI/discussions/3691
The question was if an attribute for DynamicData's
.Bind
andReadOnlyObservableCollection
could be added too. The original question was asked here: https://github.com/reactivemarbles/DynamicData/issues/348The reply of @glennawatson was, that this would be something for source generators. Therefore, I want to bring this on the table in this repository.