I'm using an ItemsControl
and a ItemTemplateSelector
to draw display the UI of my items. But now, all my elements need to be inside in a Grid
(and one of its columns the element should be there).
At the beginning I supposed was right to have a ContentControl
nested in an ItemsControl
, and this ContentControl
should have the ItemTemplateSelector
, but I'm not sure if this is the best way to do it.
Stuff like that should be in the
Template
of the item container, forItemsControls
that is a bit problematic as the containers areContentPresenters
which have noTemplate
. You could subclassItemsControl
to use aContentControl
, then use theItemsControl.ItemContainerStyle
to edit theTemplate
of those containers.