Simplified problem.
I have two ItemsControl
s that are located one under another and are bound to the same sequence:
[Control] [Another Control] [More Controls]
[Other Ctrl] [Super Control] [Control]
What I would like to do is align their sizes such that they appear to be a single table:
[Control ] [Another Control] [More Controls]
[Other Ctrl] [Super Control ] [Control ]
It would also be acceptable to go "one-way": make bottom items same size as top ones, even if they are shorter:
[Control] [Another Control] [More Controls]
[Other C] [Super Control ] [Control ]
A few considerations:
- Yes, they have to be in separate
ItemControl
s. - No, I cannot use
Grid
orDataGrid
. - I fully own the back-end data structures (if that helps)
For a more complete explanation, one can refer to my other question.
UPDATE: Why do they have to be in different ItemControls
In general, what I'm trying to achieve is to build a table that is bound to a rectangular data structure. I do not see any way to do this other than using nested ItemControl
s: one ItemControl
for rows, each item containing another ItemControl
for cells in that row. Or vice versa: one for columns, each item containing cells in that column. Either way, nested items will have to be aligned to each other.
I do realize that there may be other way to create such a table that I do not see. Which is why I also asked the other question.
Thank you, oh almighty community, in advance.