Let's say I have a class Organisation:
public class Organisation(){
public string Name{
get;
set;
}
public string Code{
get;
set;
}
}
Then I create an array of Organisation:
public Organisation[] Organisations;
The organisation information is stored in an xml and are filled into the array, which works great.
My problem is, that I'd like to bind the ItemSource of the Combobox to the Name property of my Organisations.
It would be very easy if I just have an array of strings which represent the names:
public string[] OrgansationNames = new string[]{"Organ1", "Organ2" /**/};
I could then easily bind like this:
ItemSource="{Binding Path=OrganisationNames}"
Obviously it is a little more complex and I need something like this:
ItemSource="{Binding Path=Organisations[].Name}"
It is not clear to me how I should specify the Path in this case...