Hello all:
I'm new to wpf, and I'm playing with Databinding. I've read the
introductory information.
I'm experimenting with using a ListBox as a kind of repeater, and I'm having
trouble with databinding
my Listbox uses a WPF user control for it's list items (we'll call it a
ListItem for now). That user control contains other controls that need to
databind.
You can kind of think of it like this: Each list item roughly represents a
database row, and it should be filled with field-value pairs that represent
the fields in the row.
So I can bind my listbox to a ObservableCollection of rows, and it's item
count will be correct. But, I think I need for the datacontext of each of my
list items to be set to the the member of the collection that it was created
for (so that the field-value pairs can populate)
I think that's what's missing.
My symptoms, by the way are that I end up with a listbox that has the
correct item count, but all of my item panels are empty, and the DataContext
property of all of my item panels is null.
I think I'm close. Can anyone give me hint?