views:

48

answers:

1

Apologies for the ambiguous title.

I want the items of my listbox to display similar to a photo gallery - imagine Thumbnail view on Windows File Explorer.

I have a listbox defined as so

<ListBox ItemsSource="{Binding RUFView}" x:Name="RUFs" Margin="228,34,12,12" Background="Transparent" BorderBrush="#007F9DB9">
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Orientation="Horizontal" Height="Auto"/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
</ListBox>

The ItemsSource contains a list of RUFViews that take care of displaying themselves (basically as photo boxes), which is done correctly. However the items are aligned middle left instead of top left. They also do not go onto the second line once there is too many, they scroll instead.

This may be trivial but I have no idea how to do it, any advice would be great.

Thanks.

A: 

I sorted it using this post

http://stackoverflow.com/questions/484293/wpf-listview-with-icons-view

Chris