Skip to content

[MVVM] How to bind a collection to a StackPanel instead of a ListBox? #15967

Answered by stevemonaco
slxdy asked this question in Q&A
Discussion options

You must be logged in to vote

StackPanel isn't a collection control, it's a layout control. I'm guessing that you don't want selection in which case you should use ItemsControl instead. You can replace the ItemsPanel of a collection control, but ItemsControl already has a StackPanel as its default.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@slxdy
Comment options

Answer selected by slxdy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants