What sort of control can layout child items horizontally and also uniformly resize the items to fit the available horizontal space? I'm replacing the "ItemsPanelTemplate" within a treeview template and a stackpanel will lay the items out in the correct orientation, but not resize them. A grid will only show the first child item in the treeview and lacks the support for reoriented horizontally.
A:
You can use a uniformgrid in conjunction with a viewbox:
For example
<ViewBox StretchMode= "UniformToFill">
<UniformGrid Cols="5">
</UniformGrid>
</ViewBox>
Please pay attention to the different values of the StretchMode of the ViewBox, and also the number of element in a row of the uniform grid. They depend on your data and how you want to arrange elements.
DrakeVN
2010-10-11 09:49:11
I dont think ViewBox will work in this case, because it tranforms its content, not resize. So you will see things bigger than they are supposed to be.
Euphoric
2010-10-11 10:12:56