Binding PropertyName of CollectionViewSource SortDescription in Xaml
Posted
by Faisal
on Stack Overflow
See other posts from Stack Overflow
or by Faisal
Published on 2010-06-14T08:13:48Z
Indexed on
2010/06/14
14:52 UTC
Read the original article
Hit count: 232
Here is my xaml that tells the collectionviewsource sort property name.
<CollectionViewSource Source="{Binding Contacts}" x:Key="contactsCollection" Filter="CollectionViewSource_Filter">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="DisplayName" />
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
The xaml above works fine but problem I have is that I don't know how to give a variable value to SortDescription PropertyName. I have a property in my viewmodel that tells which property to sort on but I am not able to bind this property to SortDescription's PropertyName field.
Is there any way?
© Stack Overflow or respective owner