I want to create a full screen GridView control for a Metro Style application in Windows 8 that grows and adapts to the user changing their screen resolution.
I’m trying to imitate the calendar application on Windows 8, wen you swap the metro screen between monitors, the size of each square (date) changes so that the screen is always filled.
Typically you would have a fluid ItemTemplate I need to ensure that the whole screen is full, so sometimes the GridView items will be small (when running on a tablet) and sometimes they will be large (when running on my Desktop).
Can I achieve this using XAML or do I have to get funky with changing the ItemTemplate for the GridView when the screen size changes?
The control in other xaml frameworks that does what you want is called UniformGrid. It let you specify the number of Rows or Columns and then sized each child item to the appropriate size.
UniformGrid currently doesn’t appear in the WinRT xaml stack, but it’s not difficult to port (I have done it once but don’t have access to the source). You can get the source for the Silverlight version from Jeff Wilcox – Uniform Grid.
For a calendar style app you’ll have a uniform grid for the rows and then each row will have one for the columns..