WPF binding - How to bind direction of CollectionViewSource


I am unable to bind the Direction property of a CollectionViewSource to a dependency property in my MainWindow.Xaml.cs

I get an error that "Binding must be to a dependency property".. and it is...

CollectionViewSource x:Key="peopleView" x:Name="peopleView"
                                  Source="{Binding Source={StaticResource people}}">
                    <scm:SortDescription PropertyName="Name" Direction="{Binding ?????}">



Who is Participating?
SriVaddadiConnect With a Mentor Commented:
Direction is not a dependency property and hence you cannot bind to it. Alternatively, you could create a data triggner to set the Direction based on a value.
nishant joshiTechnology Development ConsultantCommented:
might you have forgot the Path property...
vamail2Author Commented:
No.   the question marks were just placeholders for posting this example
vamail2Author Commented:
Thanks SriVaddadi - excellent.
vamail2Author Commented:
Thanks SriVaddadi
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.