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.

1 Answer 1

6

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

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.