Skip to content

BindableDerivedListAttribute with a .BindEx( this, x => x.MyDerivedList) extension method #348

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

Closed
ChaseFlorell opened this issue Apr 17, 2020 · 8 comments

Comments

@ChaseFlorell
Copy link

Is your feature request related to a problem? Please describe.

I'm a huge fan of leveraging the Rx Fody attributes in order to make my app clean and terse. One area That I'd love to see further improvement is around derived lists. Currently my derived list code looks like this.

ctor()
{
    this.WhenAnyValue(vm => vm.People)
        .Subscribe(people => people
            .ToObservableChangeSet()
            .AutoRefresh(x => x.Deleteed)
            .Filter(x => !x.Deleted)
            .Bind(out _visiblePeople)
            .Subscribe());
}

private ReadOnlyObservableCollection<Person> _visiblePeople;
public ReadOnlyObservableCollection<Person> VisiblePeople => _visiblePeople;

Describe the solution you'd like

What I'd love to be able to do is clean it up and remove the backing field

ctor()
{
    this.WhenAnyValue(vm => vm.People)
        .Subscribe(people => people
            .ToObservableChangeSet()
            .AutoRefresh(x => x.Deleted)
            .Filter(x => !x.Deleted)
            .BindEx(this, x => x.VisiblePeople)
            .Subscribe());
}

public ReadOnlyObservableCollection<Person> VisiblePeople { [BindableDerivedList] get; };

Describe alternatives you've considered

Describe suggestions on how to achieve the feature

Additional context

This would very much be akin to the existing ObservableAsPropertyAttribute

@open-collective-bot
Copy link

Hey @ChaseFlorell 👋,

Thank you for contributing to our project financially. We will handle your issue with priority support. To make sure we don't forget how special you are, we added a priority label to your issue.

Thank you again for contributing 🎉!

@ChaseFlorell
Copy link
Author

ChaseFlorell commented Apr 17, 2020

Also, if I'm just missing something that's already there, then my suggestion would be to improve the documentation as this is all I'm able to go off of.
https://reactiveui.net/docs/handbook/collections/

@RLittlesII
Copy link
Member

@ChaseFlorell Is this more of a request for DynamicData?

@ChaseFlorell
Copy link
Author

@RLittlesII ultimately it's a request for the ReactiveUI.Fody bits.

@glennawatson glennawatson transferred this issue from reactiveui/ReactiveUI Apr 21, 2020
@glennawatson
Copy link
Member

User wants a fody for dynamic data.

@RLittlesII
Copy link
Member

@ChaseFlorell I think this is doable. We have some work coming up soon around Fody. So we can evaluate this when we target that work.

@RolandPheasant
Copy link
Collaborator

I am not sure what is required? Is it still relevant? If so please reopen and let's discuss further.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants