Need help for displaying numbers on images in WPF
i have a button and a listbox on my WPF window, when i click on button all the images should display in the listbox.up to here it is fine and working my code:
XAML code for listbox:
<pre lang="xml"><ListBox
Name="Frameslistbox"
SelectionChanged="Frameslistbox_SelectionChanged"
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Margin="8,0,0,8"
Width="150"
Height="146.5">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel
Orientation="Horizontal">
<Image
Source="{Binding}"
Height="100"></Image>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
List <bitmapimage> myimages=new List<bitmapimage>();
DirectoryInfo myimagesdir=new DirectoryInfo(@".\\Output");
foreach(FileInfo myimagesfile in myimagesdir.GetFiles("*.jpg"))
{
Uri imguri=new Uri(myimagesfile.FullName );
myimages .Add(new BitmapImage(imguri));
}
Frameslistbox.ItemsSource =myimages;</bitmapimage></bitmapimage>
now in the list box for each image i want to display numbers in the listbox above image like if i have 10 images(images may change every time), i want 1,2,3---10 on respective images.
i have tried textblock but not got any thing
plz help how to bind numbers to images .
Thanks,