Bind ListBox to List<Image>
Posted
by Pyush
on Stack Overflow
See other posts from Stack Overflow
or by Pyush
Published on 2010-05-29T03:18:10Z
Indexed on
2010/05/29
3:22 UTC
Read the original article
Hit count: 209
wpf-binding
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.
© Stack Overflow or respective owner