Im trying to make the children’s game: memory in wpf, i have a list of “Tile” which has an image on them. I want to lay the Tiles out in my Board (also a class with a list of Tile). I need to make the control for layout and then lay it out in e.g. a 4 x 4 matrix.
How to I bind my List to an amount of controls (maybe buttons?) and spread them out on my board?
You can use an
ItemsControl, bind itsItemsSourceto your list, make anItemTemlatewhich contains a Button and set theItemsPanelto something like aUniformGridor aWrapPanel.