I\'m trying to create an ItemsControl
that uses a grid as its ItemsPanel
in such a way that it has two columns, where the first columns width is the wi
There are multiple problems here for an ItemsControl
:
ItemsControl
The last one is really the biggest problem, because an ItemsControl
wraps each ItemTemplate
in a ContentPresenter
, so there is no default way of creating more than one item in the panel for each Iteration of the ItemsControl
. Your end result would look like this:
...
My best suggestion would be to create an ItemTemplate
that contains a 1x2 Grid
, and use Grid.IsSharedSizeScope
to make the width of the first column shared. (The ItemsPanelTemplate
would remain the default StackPanel
.)
This way, the end result would look like this:
...