Bind ListBox to List<Image>
- by Pyush
I need to bind a List of Images to a list box.
My code being:
<ListBox x:Name="lstImages">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type Image}">
<StackPanel>
<Image Source="{Binding Path=UnassignedImages}"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Code behind:
lstImages.ItemsSource = this.audit.UnassignedImages;
Where UnassignedImages being List
I tried using both lstImages.ItemsSource & lstImages.DataContent, but none works.
Thanks.