0

ReactiveUI 3.2.0.0 曾经有实现 ObserveCollectionChanged() 方法的 CollectionExtensions 类。现在 ReactiveUI 4.0.2 下的方法在哪里?

    private readonly ReactiveCollection<string> _sourceItems = new ReactiveCollection<string>();
    private readonly ReactiveCollection<SelectableDataItem<string>> _selectableItemsView = null;
    private readonly ReactiveCollection<SelectableDataItem<string>> _selectedItemsView = null;
    private readonly ReactiveCollection<string> _selectedDataView = null;

    ....


        this._sourceItems.ChangeTrackingEnabled = true;

        this._selectableItemsView =
            this.SourceItems.CreateDerivedCollection<string, SelectableDataItem<string>>(i => new SelectableDataItem<string>(i) { IsSelected = true, });
        this._selectableItemsView.ChangeTrackingEnabled = true;
        this._selectedItemsView =
            this._selectableItemsView.CreateDerivedCollection<SelectableDataItem<string>, SelectableDataItem<string>>(
            i => i,
            f => f.IsSelected,
            (i1, i2) => 0
            );
        this._selectedItemsView.ChangeTrackingEnabled = true;
        this._selectedDataView =
            this._selectableItemsView.CreateDerivedCollection<SelectableDataItem<string>, string>(i => i.Data, f => f.IsSelected, (i1, i2) => 0);
        this._selectedDataView.ChangeTrackingEnabled = true;
4

1 回答 1

0

升级到 ReactiveUI 4.1 并使用someCollection.CreateDerivedCollection- 所有的工作都已经为你完成了 :)

于 2012-12-04T20:54:09.903 回答