Sunday, May 6, 2012
Windows 8 metro XAML - VariableSizedWrapGrid
VariableSizedWrapGrid for metro apps provides a grid-style layout panel where each tile/cell can be variable size based on content.If your first item is a big item and the subsequent items are small, then you will see that all the subsequent items are shown at the same size. If your first item is small and one/all subsequent items are bigger than the first item, then the subsequent items are clipped to the size of the first item. This is the behaviour of VSWG. You will need to use rowspan and colspan properties to achieve the variable size effect you want. Also you may need to set ItemHeight and ItemWidth properties.
Here is the reason why?
VSWG allows for variable sized items but the item sizes allowed are in multiples of the base cell size. The size of the layout cell is determined by ItemHeight and ItemWidth properties. If these properties are not set, then the item is measured in integral multiplication of the cell size based on RowSpan and ColumnSpan properties.
Features that are not supported yet in VSWG:
1. You can not reorder items in a gridview with a variablesizedwrapgrid. It would be nice if microsoft implements this.
2. You can not change the size of an item once it is set.
Subscribe to:
Posts (Atom)