Right now I have a listbox inside which a scrollviewer and a stackpanel is placed with the data binding to the observablecollection of imagelist.
I am having a photolist class which holds the image and path of it and binding it to the listbox.
<Style TargetType="{x:Type ListBox}">
<Setter Property="Foreground" Value="White" />
<Setter Property="Margin" Value="100"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}" >
<ScrollViewer>
<StackPanel IsItemsHost="True" Orientation="Horizontal" HorizontalAlignment="Center"/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The above code works fine showing the listbox with a scroller and stackpanel hosting the multiple images.
Now I would like to modify the listbox to have scrollviewer and a grid instead of stackpanel, so that the images are positioned like the matrix form.
Please provide me a code snippet to bind the photolist to the grid(inside a scrollviewer which is inside a listbox).
Any help would be highly appreciated.