What is the accepted / best method for sorting / filtering an ObervableCollection in Community Toolkit MVVM? #18038
-
Hi, Right now im using the method of sorting / filtering in a list and then use that to toggle visibility and move items in the observable collection. While this works, it is slow and it is starting to become difficult to add more options and maintain. I tried with this, but it dosent work. Probably because im not using ReactiveUI. Im using Community MVVM with compiled bindings. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
DynamicData is technically separate from ReactiveUI (though it's used by and maintained by their team, in part). You can import the However, ReactiveUI has some nice extensions that you may need. I'm not sure how easily these can be included in your app without also taking a dependency on ReactiveUI. Even if you do, you can use Mvvm Toolkit + ReactiveUI side-by-side if you're careful about it. This is what I've done in the past, but the extra dependency didn't really matter. An alternative is ObservableCollections + R3 which should also be usable with Mvvm Toolkit. It's a much newer framework so I haven't really tested it yet. They have an Avalonia sample at https://github.com/Cysharp/ObservableCollections/blob/6f5de33bff1cad05b3ad4ff56583ad4919ba9f9c/sandbox/AvaloniaApp/MainWindow.axaml.cs |
Beta Was this translation helpful? Give feedback.
DynamicData is technically separate from ReactiveUI (though it's used by and maintained by their team, in part). You can import the
System.Reactive
andDynamicData
packages into an Mvvm Toolkit app.However, ReactiveUI has some nice extensions that you may need. I'm not sure how easily these can be included in your app without also taking a dependency on ReactiveUI. Even if you do, you can use Mvvm Toolkit + ReactiveUI side-by-side if you're careful about it. This is what I've done in the past, but the extra dependency didn't really matter.
An alternative is ObservableCollections + R3 which should also be usable with Mvvm Toolkit. It's a much newer framework so I haven't really tested it …