I'm using MVVM and Ms Toolkit.
I'm showing a collection within a CollectionView, but I would like to hide deleted items (set by a flag on model).
This why I'm using a global "save" procedure in a tabs page but it would be nice to hide what I've deleted.
I've tried with Where(p => p.deleted == false) but:
- won't work on ObservableColletion
- return a IEnumerable
Searched Google & Docs already.
Returning IEnumerable is not a problem, because it can be converted to list:
https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.tolist?view=net-8.0
It will work on ObservableCollection, because you have constructor that takes list as parameter.
https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1.-ctor?view=net-8.0#system-collections-objectmodel-observablecollection-1-ctor(system-collections-generic-list((-0)))
Also, even if anything of the above was not true, you can always:
I do it all the time.