.net - WPF SharedGridSize group with ItemsControl embedded Grids -
i trying embed multiple grids within grid using itemscontrol
, have child grids share same row heights:
<grid> <itemscontrol itemssource="{binding controlitems}"> <itemscontrol.itemspanel> <custompanel></custompanel> </itemscontrol.itemspanel> <itemscontrol.datatemplate> <customcontrol/> </itemscontrol.datatemplate> </itemscontrol> </grid>
where customcontrol customized grid this:
<grid> <grid.rowdefinitions> <rowdefinition sharedsizegroup="customcontrolgroup" /> <rowdefinition sharedsizegroup="customcontrolgroup" /> <grid.rowdefinitions> </grid>
however rows in child grids not share same size?
well according article. must set issharedsizescope
property in parent control true
. should more like:
<itemscontrol grid.issharedsizescope="true"> <grid> <grid.rowdefinitions> <rowdefinition sharedsizegroup="customcontrolgroup" /> <rowdefinition sharedsizegroup="customcontrolgroup" /> <grid.rowdefinitions> </grid> </itemscontrol>
here example msdn. imho, first article more understandable.
Comments
Post a Comment