WPF binding - How to bind direction of CollectionViewSource

Hi,

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}}">
                <CollectionViewSource.SortDescriptions>
                    <scm:SortDescription PropertyName="Name" Direction="{Binding ?????}">


                    </scm:SortDescription>

                </CollectionViewSource.SortDescriptions>

            </CollectionViewSource>
vamail2Asked:
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.
0
 
nishant joshiTechnology Development ConsultantCommented:
might you have forgot the Path property...
0
 
vamail2Author Commented:
No.   the question marks were just placeholders for posting this example
0
 
vamail2Author Commented:
Thanks SriVaddadi - excellent.
0
 
vamail2Author Commented:
Thanks SriVaddadi
0
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.