wpf - Arranging collection items in a grid -


I would like to manage the collection items in a grid with any specific columns and rows (say 4x6). Each item's dependency property (integer) displays X and Y and should be kept in the relevant cell of the grid. Note that the archive can change grid items that can change during runtime.

I could not find any good solution. But maybe this code is possible without the back?

Do not believe in conversions or some things, this stuff changes anyway. The collection class used is not important (you can choose one.)

How can I solve this problem? Thanks

  and lieutenant; Itemcontrol itemsource = "{binding your rectangles}" & gt; & Lt; ItemsControl.ItemsPanel & gt; & Lt; ItemsPanelTemplate & gt; & Lt; Grid / & gt; & Lt; / ItemsPanelTemplate & gt; & Lt; /ItemsControl.ItemsPanel> & Lt; ItemsControl.ItemContainerStyle & gt; & Lt; Style & gt; & Lt; Setter property = "grid.column" value = "{binding X}" /> & Lt; Setter property = "grid. Row" value = "{binding y}" /> & Lt; / Style & gt; & Lt; /ItemsControl.ItemContainerStyle> & Lt; / ItemsControl>  

Comments