views:

17

answers:

1
+1  A: 

Hi,

you can try to do this with a ListBox with an ItemsPanel that uses a horizontal layout for the items (I'm just binding to a list of strings in my example). HTH.

Code:

public List<string> Properties { get; set; }

XAML:

<ListBox ItemsSource="{Binding Properties}">
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"
                            ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}"
                            MinWidth="{Binding ItemWidth, RelativeSource={RelativeSource Self}}"
                            ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" />
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>

    <ListBox.ItemTemplate>
        <DataTemplate>
            <TextBlock>
                <Hyperlink NavigateUri="{Binding}">
                    <TextBlock Text="{Binding StringFormat={}{0} >}"/>
                </Hyperlink>
            </TextBlock>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

Screenshot:

alt text

andyp
Perfect, thanks for your quick response, it worked great!