wpf - How to set SortDescriptions of CollectionView in C# -


i have defined sortdescriptions , groupdescriptions in xaml.

        <collectionviewsource x:key="defaultgrouping" source="{binding projects}">             <collectionviewsource.sortdescriptions>                 <componentmodel:sortdescription propertyname="projectname" direction="ascending" />                 <componentmodel:sortdescription propertyname="creationdate" direction="descending"/>                 <componentmodel:sortdescription propertyname="lastusedtime" direction="descending"/>             </collectionviewsource.sortdescriptions>             <collectionviewsource.groupdescriptions>                 <propertygroupdescription propertyname="default"/>             </collectionviewsource.groupdescriptions>         </collectionviewsource> 

and want change sortdescriptions in code of viewmodel. following code empty listcollectionview.

collectionviewsource.getdefaultview(this.projects);

is there way right collectionview?


Comments