0

I want to show a list of "properties" in my application. A property is simply a name/value pair. The number of properties is dynamic.

The best way to do this? The only thing I can come up with is creating a ListView with an ItemTemplate. But then the items are selectable, and that's not what I want. If I make the list read-only, it becomes gray. Don't like that either.

Anyone has a better suggestion?

Robbert Dam
  • 4,027
  • 10
  • 39
  • 58

2 Answers2

3
<ScrollViewer>
    <ItemsControl ItemsSource="{Binding Properties}">
        <ItemsControl.ItemTemplate>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Name}"/>
                <TextBlock Text="{Binding Value}"/>
            </StackPanel>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</ScrollViewer>

Use a Grid for ItemsControl.ItemsPanel with SharedSizeGroup if you want all items to line up nicely.

Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
0

Look here: http://www.codeplex.com/wpg or here http://dvuyka.spaces.live.com/blog/cns!305B02907E9BE19A!448.entry

They are both implmentations of PropertyGrid from WinForms

Timotei
  • 1,909
  • 2
  • 22
  • 31