<?xml version="1.0" encoding="utf-8"?>
<Window x:Class="AmazonBooksSamples.AmazonBooksWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:AmazonBooksSamples"
        Title="Amazon Books" 
        Height="600" 
        Width="800">
    <Grid>
        <Grid.Resources>
            <DataTemplate x:Key="IconTemplate">
                <Path Width="20" Height="20" Fill="{Binding Background}" Stretch="Uniform" Stroke="Black" StrokeThickness="1" StrokeLineJoin="Round" VerticalAlignment="Stretch"  Data="M74,40 L76.5,35 L79,40 L85,41 L80.5,44.5 L81.291664,50 L76.5,47.583332 L71.645836,50 L72.5,44.5 L68,41 z" />
            </DataTemplate>
        </Grid.Resources>
        <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 Text="Title:" FontWeight="Bold" />
                                <Run Text="{Binding Path=Title}"/>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap">
                                <Run Text="ISBN:" FontWeight="Bold" />
                                <Run Text="{Binding Path=Id}"/>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap">
                                <Run Text="Author:" FontWeight="Bold" />
                                <Run Text="{Binding Path=Author}"/>
                            </TextBlock>
                            <TextBlock TextWrapping="Wrap">
                                <Run Text="Price:" FontWeight="Bold" />
                                <Run Text="{Binding Path=Price}" FontSize="18"/>
                            </TextBlock>
                            <Grid>
                                <StackPanel>
                                    <c1:C1BarCode Text="{Binding Path=Id}" AutoSize="False" HorizontalAlignment="Left" CaptionPosition="Below"
                                               CodeType="EAN_13" Width="200" Height="100" BarHeight="0">
                                    </c1:C1BarCode>
                                    <c1:C1Rating  Value="4" DataContext="{x:Null}" HorizontalAlignment="Left" ItemTemplate="{StaticResource IconTemplate}" RatedBrush="#57BEE1" HoveredBrush="Yellow" UnratedBrush="Transparent"/>
                                </StackPanel>
                            </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" Orientation="Vertical">
                            <TextBlock TextWrapping="Wrap" >
                                <Run Text="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>
</Window>