Share via


Image and text list (landing narrow) 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 ListView to display a landing page collection when your app is narrow.

This example shows the DataTemplate and a ListView that uses the template.

<DataTemplate x:Key="ImageTextLandingNarrowTemplate">          
    <StackPanel Orientation="Horizontal" Width="292" Height="60">
        <Border Height="40" Width="40" Margin="10,10,0,10">
            <Image Source="/SampleImage.png" Stretch="UniformToFill"/>
        </Border>
        <StackPanel Orientation="Vertical" VerticalAlignment="Top" Margin="0,10,0,0">
            <TextBlock Text="Ayaecenas aliquam tellus nec loren ipsum" 
                       Margin="10,0,0,0" Width="180" Height="42" 
                       HorizontalAlignment="Left" TextTrimming="WordEllipsis" TextWrapping="Wrap"/>
        </StackPanel>
    </StackPanel>             
</DataTemplate>
<ListView x:Name="ImageTextLandingNarrowGrid" Width="292" 
          VerticalAlignment="Stretch" HorizontalAlignment="Left" 
          CanReorderItems="True" CanDragItems="True" 
          ItemTemplate="{StaticResource ImageTextLandingNarrowTemplate}"/>