WPF Binding Path=/ not working?
- by Mark
I've set up my DataContext like this:
<Window.DataContext>
<c:DownloadManager />
</Window.DataContext>
Where DownloadManager is Enumerable<DownloadItem>. Then I set my DataGrid like this:
<DataGrid Name="dataGrid1" ItemsSource="{Binding Path=/}" ...
So that it should list all the DownloadItems, right? So I should be able to set my columns like:
<DataGridTextColumn Binding="{Binding Path=Uri, Mode=OneWay}"
Where Uri is a property of the DownloadItem. But it doesn't seem to like this. In the visual property editor, it doesn't recognize Uri is a valid property, so I'm guessing I'm doing something wrong.
It was working before, when I had the data grid binding to Values, but then I took that enumerable out of the DownloadManager and made itself enumerable. How do I fix this?
PS: By "doesn't work" I mean it doesn't list any items. I've added some to the constructor of the DM, so it shouldn't be empty.