Compartir a través de


Text tile (landing) template (XAML)

[ This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation ]

Use this item template with a GridView to create a landing page that displays a collection with a tile and text.

This example shows the image gallery DataTemplate and a GridView that uses the template.

<DataTemplate x:Key="TextTileLandingTemplate"> 
    <Grid Background="DarkGray" Width="250" Height="250">        
        <StackPanel Orientation="Vertical" VerticalAlignment="Bottom" Margin="0,0,0,10"> 
            <TextBlock Text="Ay Lorem ipsum dolor site amet yed diam nonumy" 
                       FontSize="24"  Margin="10,0,0,0" 
                       TextTrimming="WordEllipsis" TextWrapping="Wrap" 
                       HorizontalAlignment="Left"/>                        
            <TextBlock Text="Ay Phasellus faucibus" 
                       FontSize="11" Margin="10,0,0,0" 
                       TextTrimming="WordEllipsis" TextWrapping="Wrap" 
                       HorizontalAlignment="Left"/>
        </StackPanel>
    </Grid>                
</DataTemplate>
<GridView x:Name="TextTileLandingGrid" 
          VerticalAlignment="Stretch" HorizontalAlignment="Left" 
          CanReorderItems="True" CanDragItems="True" 
          ItemTemplate="{StaticResource TextTileLandingTemplate}">
    <GridView.ItemsPanel>
        <ItemsPanelTemplate>
            <ItemsWrapGrid MaximumRowsOrColumns="2"/>                      
        </ItemsPanelTemplate>
    </GridView.ItemsPanel>
</GridView>