CollectionViewSource no sorting available in Windows Universal Apps (Windows 10), Is there any alternative to do this in XAML with this technology?

CollectionViewSource no sorting available in Windows Universal Apps (Windows 10), Is there any alternative to do this in XAML with this technology?

I am trying to sort a Observable Collection of objects to then bind to a ListView.
Alejandro AcevedoSr. [.NET] Developer/Systems Analyst/ConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

it_saigeDeveloperCommented:
Could you provide a code example.  I find it hard to believe that something as essential as sorting is not available.

-saige-
Alejandro AcevedoSr. [.NET] Developer/Systems Analyst/ConsultantAuthor Commented:
I wonder if in windows 10 I can do something similar like below:

<CollectionViewSource x:Key="MyCVS"
                              Source="{StaticResource CulturesProvider}">
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="IetfLanguageTag" />
            </CollectionViewSource.SortDescriptions>
            <CollectionViewSource.GroupDescriptions>
                <dat:PropertyGroupDescription PropertyName="Parent" />
            </CollectionViewSource.GroupDescriptions>
        </CollectionViewSource>

But in Windows 10 I do not have those available. I had to do a orderby with linq in a temp List and then add the sorted list into my VM property collection.
it_saigeDeveloperCommented:
Interesting.  I apologize, you are correct, for some odd reason, someone decided that the CollectionViewSource (more specifically, the ICollectionView interface) did not need filtering or sorting functionality (maybe they were thinking that since it is a view, the source should be sorted and filtered before being presented to the view).

Anywho, Bernardo Castilho has a write-up over at code project that discusses a solution based upon extending the ICollectionView interface.

http://www.codeproject.com/Articles/527686/A-WinRT-CollectionView-class-with-Filtering-and-So

-saige-

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.