• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 954
  • Last Modified:

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>
0
vamail2
Asked:
vamail2
  • 3
1 Solution
 
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
 
SriVaddadiCommented:
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
 
vamail2Author Commented:
Thanks SriVaddadi - excellent.
0
 
vamail2Author Commented:
Thanks SriVaddadi
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now