One way you can go is to use the built-in properties of the GridView selector.
See my blog post .
In a nutshell, you can create your own StyleSelector. All you have to do is override the StyleSelectorCore () method and put in your logic a style selection that defines spaces in a column or row.
You will need to get the default GridViewItem style template through Blend or an online resource and create an explicit default style. Then create new BasedOn styles explicitly, for example:
<Style x:Key="DoubleHeightGridViewItemStyle" BasedOn="{StaticResource DefaultGridViewItemStyle}" TargetType="GridViewItem"> <Setter Property="VariableSizedWrapGrid.RowSpan" Value="2" /> </Style>
For this, you will also need to modify the GridView ItemsPanel template to use VariableSizedWrapGrid.
Finally, by creating your own DataTemplateSelector, you can modify the DataTemlates of your related items. You will need to do this if your large-sized items cannot use the same DataTemplate as the default size.
source share