Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: ReactiveUI.Fody [ReactiveCollection] attribute for adding change notifications from collections #3302

Open
MGRussell opened this issue Jul 1, 2022 · 1 comment

Comments

@MGRussell
Copy link

MGRussell commented Jul 1, 2022

The [Reactive] attribute in Fody is extremely handy for reducing boiler plate and clutter, but does not have a comparable partner for observable collections. Would it be reasonable to add a [ReactiveCollection] attribute that results in similar notifications for collection changes?

One implementation idea may be to tie such notifications into a change notification on the property itself, so that if the list is recreated it will continue to deliver notifications: this.WhenAnyValue(x => x.SomeObservableCollection).Do(x => x.CollectionChanged += (_,_) => this.RaisePropertyChanged(nameof(SomeObservableCollection))).Subscribe(); . This would then be added into any constructor which is not called by another constructor.

@tomasfil
Copy link
Contributor

Hello, there is new source generator in works as Glenn noticed here:
https://github.com/reactiveui/ReactiveObject.Generators/issues/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants