<Page
    x:Class="TileViewSamples.AmazonBooksPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TileViewSamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" xmlns:c1="using:C1.Xaml.TileView"
    xmlns:barCode="using:C1.Xaml.BarCode"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <c1:C1TileView x:Name="c1TileView1" UpdateSourceCollection="False" CanUserReorder="False" Foreground="Black">
            <c1:C1TileView.ItemTemplateMaximized>
                <DataTemplate>
                    <Grid Margin="0 20 0 0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="60*" />
                            <RowDefinition Height="40*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Image Source="{Binding Path=CoverUri}" Stretch="Uniform" />
                        <StackPanel Grid.Column="1">
                            <TextBlock TextWrapping="Wrap">
                                <Run x:Uid="/TileViewSamplesLib/Resources/Title" FontWeight="Bold" />
                                <Run Text="{Binding Path=Title}"/>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap">
                                <Run x:Uid="/TileViewSamplesLib/Resources/ISBN" FontWeight="Bold" />
                                <Run Text="{Binding Path=Id}"/>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap">
                                <Run x:Uid="/TileViewSamplesLib/Resources/Author" FontWeight="Bold" />
                                <Run Text="{Binding Path=Author}"/>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap">
                                <Run x:Uid="/TileViewSamplesLib/Resources/Price" FontWeight="Bold" />
                                <Run Text="{Binding Path=Price}" FontSize="18"/>
                            </TextBlock>
                            <Grid>
                                <barCode:C1BarCode Text="{Binding Path=Id}" AutoSize="False" HorizontalAlignment="Left" CaptionPosition="Below"
                                               CodeType="EAN_13" Width="200" Background="Transparent" Height="100" BarHeight="0">
                                </barCode:C1BarCode>
                            </Grid>
                        </StackPanel>
                       
                        <TextBlock Margin="0 20 0 0" TextWrapping="Wrap" Text="{Binding Path=Description}" Grid.Row="1" Grid.ColumnSpan="3" MaxWidth="800" HorizontalAlignment="Left" />
                    </Grid>
                </DataTemplate>
            </c1:C1TileView.ItemTemplateMaximized>
            <c1:C1TileView.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Image Source="{Binding Path=CoverUri}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                        <StackPanel Grid.Column="1">
                            <TextBlock TextWrapping="Wrap" >
                                <Run x:Uid="/TileViewSamplesLib/Resources/Price" FontWeight="Bold" />
                                <Run Text="{Binding Path=Price}" FontSize="18"/>
                            </TextBlock>
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </c1:C1TileView.ItemTemplate>
            <c1:C1TileView.ItemTemplateMinimized>
                <DataTemplate>
                    <Grid>
                        <Image Height="100" HorizontalAlignment="Center" Source="{Binding Path=CoverUri}" VerticalAlignment="Center" />
                    </Grid>
                </DataTemplate>
            </c1:C1TileView.ItemTemplateMinimized>
            <c1:C1TileView.ItemTemplateHeader>
                <DataTemplate>
                    <TextBlock Text="{Binding Path=Title}" MaxWidth="400" />
                </DataTemplate>
            </c1:C1TileView.ItemTemplateHeader>
        </c1:C1TileView>
    </Grid>
</Page>
