I’m needed to create a list box as in below format;
[x] [x] ^
[x] [x] |
[x] [x] | ----> this is a side scroll and the [x] are pictures
[x] [x] |
How can I do it? Here is my code now.
<controls:PanoramaItem Header="New one" Name="Pan1" >
<ListBox Margin="0,0,-12,0" x:Name="NewTitlesListBox"
ItemsSource="{Binding NewPicturesLocal}"
SelectionChanged="NewListBoxSelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,0,0,20">
<Image Width="110" CacheMode="BitmapCache" Source="{Binding ThumbURL}"
Margin="12,0,9,0"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</controls:PanoramaItem>
The result of this:
[x] ^
[x] |
[x] | ----> this is a side scroll and the [x] are pictures
[x] |
I was trying to do it with Grid (adding more columns) and with Data Templating, but didn’t find the solution.
An easy solution would be to use the WrapPanel from the Silverlight Toolkit:
WrapPanel for WP7. You would have to set the ItemsPanelTemplate for your ListBox to use the WrapPanel. There’s an example of that in the comments of the page I linked to.