首页 > 解决方案 > ReactiveUi how to use ICollectionView with the Getting started example

问题描述

I'm learning ReactiveUi and trying the sample from here https://reactiveui.net/docs/getting-started/ This is a great examle, but now I would like to replace the List SearchResults with a ICollectionView to have more grouping / sorting capability.

The documentation contains a ReactiveCollectionViewSource here and but I'm unable to find a sample how to use it with the starting code. Is that the right track?

标签: wpfreactiveui

解决方案


The ReactiveCollectionViewSource is for the iOS project only.

You should be able to use standard WPF ways of generating your CollectionView and use CollectionViewSource.GetDefault() etc.

You can then use WPF or ReactiveUI bindings to bind that to your controls.

One thing of note is that DynamicData is going to be in the near future the preferred solution for data management in RxUI projects. Worth seeing if it fits in your problem space. https://github.com/RolandPheasant/DynamicData - There is a DynamicData channel on the Reactive slack channel if you need help with the framework https://reactiveui.net/slack


推荐阅读