I have a dictionary:
private Dictionary<int, ICar> _ICarsDic;
The object ICar actually contains another list of objects:
public interface ICar
{
int carId { get; set; }
string carName { get; set; }
Dictionnary<int,IBrandsDetails> brandsDetails { get; set; }
}
I am binding this CarsDic dictionnary to a DataGrid (transforming it to an IEnumerable before but that's not the point of the question so no showing here).
<DataGrid Name="Cars"
ItemsSource="{Binding}"
SelectedItem="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}, AncestorLevel=2}, Path=SelectedCar, Mode=TwoWay}">
<DataGrid.Columns>
<DataGridTextColumn Header="Car Id" Binding="{Binding CarId}" IsReadOnly="True" />
<DataGridTextColumn Header="Car Name" Binding="{Binding carName}" IsReadOnly="True" />
</DataGrid.Columns>
My problem is that I'd like to display some data from the BrandsDetails as well (common to all the cars), like for example the logo. This synthax doesn't work though:
<DataGridTextColumn Header="Full Name" Binding="{Binding BrandsDetails.Logo}" IsReadOnly="True" />
Thank you in advance for your answers!