asusralis
Topic Author
Posts: 142
Joined: 30 Jul 2018, 05:03

Is CollectionViewSource usable for sorting?

24 Nov 2018, 23:19

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?
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

Re: Is CollectionViewSource usable for sorting?

26 Nov 2018, 16:56

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.
 
asusralis
Topic Author
Posts: 142
Joined: 30 Jul 2018, 05:03

Re: Is CollectionViewSource usable for sorting?

28 Nov 2018, 18:09

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.
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

Re: Is CollectionViewSource usable for sorting?

03 Dec 2018, 14:23

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;

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Semrush [Bot] and 83 guests