how to bind image dynamically inside listbox
My code is here:
<ListBox VerticalAlignment="Stretch" SelectionMode="Extended" Height="600" Width="313">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="25" Width="25">
<Image Source="{Binding img}" >
<Image.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Image.RenderTransform>
</Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
And I add code
List<Person> myl = new List<Person>();
myl.Add(new Person { img = "Images/s1.jpeg" });
myl.Add(new Person { img = "Images/s2.jpeg" });
listBox.ItemsSource = myl;
The image not binded.There is no error while running.