Page 1 of 1
Is CollectionViewSource usable for sorting?
Posted: 24 Nov 2018, 23:19
by asusralis
It doesn't complain when it's used, and I see it in Noesis' documents, but it seems sort description doesn't exist.
NoesisException: Unknown type 'System.ComponentModel.SortDescription'.
If not, what can it be used for right now?
Re: Is CollectionViewSource usable for sorting?
Posted: 26 Nov 2018, 16:56
by sfernandez
Sorry but sorting is not implemented in Noesis:
https://www.noesisengine.com/bugs/view.php?id=412
Sorting needs to be done in the underlying observable collection.
The best approach could be to sort everything in a new collection and then swap it, so you only notify of a reset change.
Re: Is CollectionViewSource usable for sorting?
Posted: 28 Nov 2018, 18:09
by asusralis
Ah, ok. Thanks. I've read that thread, but I was confused that CollectionViewSource didn't throw a not found exception from Noesis, so I didn't know if it could be used for other things.
Re: Is CollectionViewSource usable for sorting?
Posted: 03 Dec 2018, 14:23
by sfernandez
With current implementation CollectionViewSource can only be used as a wrapper of a Collection.
<Grid.Resources>
<CollectionViewSource x:Key="people" Source="{Binding People}"/>
</Grid.Resources>
And provides access to the generated CollectionView.
CollectionView view = people.View;