ReactiveUI-为IReactiveDerivedList创建可观察到的“ IsReseting”

时间:2018-06-29 20:17:23

标签: system.reactive reactiveui

如何为{"Customer": [ { "CustomerID": "ALFKI", "CompanyName": "Alfreds Futterkiste", "ContactName": "Maria Anders", "ContactTitle": "Sales Representative", "Address": "Obere Str. 57", "City": "Berlin", "Region": null, "PostalCode": "12209", "Country": "Germany", "Phone": "030-0074321", "Fax": "030-0076545" }, { "CustomerID": "ANATR", "CompanyName": "Ana Trujillo Emparedados y helados", "ContactName": "Ana Trujillo", "ContactTitle": "Owner", "Address": "Avda. de la Constitución 2222", "City": "México D.F.", "Region": null, "PostalCode": "05021", "Country": "Mexico", "Phone": "(5) 555-4729", "Fax": "(5) 555-3745" } ]} 触发IObservable<bool>并立即返回true的情况ShouldReset创建IReactiveDerivedList的{​​{1}}“ IsReseting”列表是重新计算的(可能没有任何项目)?

我想在应用过滤器时显示一些活动指示器。

1 个答案:

答案 0 :(得分:-1)

我已完成以下操作:

_isReseting= MyDerivedList
                .ShouldReset
                .Select(_ => true)
                .Merge(MyDerivedList
                    .Changed
                    .Select(_ => false))
                .ToProperty(this, x => x.IsReseting);