Sometimes, we want to display a list of items with different layout like details, mozaic, minimize, … You can use an ItemTemplateSelector to achieve this but there’s a little trick because ItemTemplateSelector is one shot :


<Button Content="Change display" Click="ChangeDisplayType" />

<GridView x:Name="content" ItemsSource="{Binding Contents}">
        <Common:MyTemplateSelector />

Code behind

private void ChangeDisplayType(object sender, RoutedEventArgs e)
    // TODO : Change display type like list, mosaic, detail, ... 

    // We need to do this to refresh the size of the each items 
    // because the ItemTemplateSelector is one shot
    var temp = content.ItemTemplateSelector;
    content.ItemTemplateSelector = null;
    content.ItemTemplateSelector = temp;

Have fun !