Skip to content

AutoRefresh doesn't work in this situation? #615

Answered by kurtyoder
kurtyoder asked this question in Q&A
Discussion options

You must be logged in to vote

Of course I immediately get it working! I'll leave this post here in case someone is facing a similar situation. Still very curious as to thoughts on implementation.

Added a new filter:

 public Func<OrderAddonReactiveModel, bool> AddonParentFilter() => addon =>
    {
        bool good = (addon.Parent?.Qty ?? 1) != 0;

        if (!good && addon.Qty != 0)
            addon.Qty = 0;
        return good;
    };

Updated the binding

_addonsSource
          .Connect()
          .Filter(x => x.Type == "Door")
          .AutoRefresh(x => x.Parent.Qty)
          .Filter(AddonParentFilter())
          .Filter(addonFilterPredicate)
          .Filter(doorSearchPredicate)
          .SortBy(x => x.Dis…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RolandPheasant
Comment options

@kurtyoder
Comment options

Answer selected by kurtyoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants