views:

45

answers:

1

Basically I want something like the old VB 6 DataRepeater, where every item in a collection is bound to a template. The only feature I want the container to have is scrolling and data-binding, the other stuff like being able to select items just gets in the way.

P.S. If you can't recommend anything I'm just going to use a stack panel and manually create/destroy the objects as necessary.

+6  A: 

Use an ItemsControl.

Set the ItemsControl.ItemsPanel to contain a StackPanel with ScrollViewer.ScrollBars set, if you have lots of Items in your collection use a VirtualizingStackPanel for better performance.

Each item can be templated in with the ItemsControl.ItemTemplate.

See ItemsControl for more info and an example

benPearce
Perfect. It does everything I want, nothing I don't, and is easy to use.
Jonathan Allen