-
October 9th, 2011, 08:38 AM
#1
Binding ListView to SortedList
I have a ListView that I want to bind to a SortedList. The SortedList is a property of a class that is a static member of my App class.
In my C# code, I can access the SortedList as shown below...
App.ApplianceHandles.SortedHandles
and iterate over the list using...
App.ApplianceHandles.SortedHandles.Values
In XAML I have tried to add the ItemsSource and optionally the DisplayMemberPath to the ListView in a variety of ways none of which work...
<ListView ... ItemsSource="{Binding}" DisplayMemberPath="App.ApplianceHandles.SortedHandles" ... >
<ListView ... ItemsSource="{Binding Source={StaticResource App}}" DisplayMemberPath="ApplianceHandles.SortedHandles" ... >
<ListView ... ItemsSource="{Binding Source={DataContext App.ApplianceHandles.SortedHandles}}" ... >
I am quite confused on how to specify the items source. What is the correct way to specify this?
Thanks in advance for any help given.
Duff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|