<Page x:Class="ExamBoldin.pgListBooks"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:ExamBoldin"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="pgListBooks">
    <Page.Resources>
        <DataTemplate x:Key="outputBooks">
            <Border BorderBrush="Black" BorderThickness="1,1,1,1">
                <StackPanel Orientation="Horizontal" Width="600px">
                    <StackPanel VerticalAlignment="Center">
                        <Image Source="{Binding Cover}" Width="100px" Height="100px"  HorizontalAlignment="Center"></Image>
                    </StackPanel>
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Название: "></TextBlock>
                            <TextBlock Text="{Binding Name}"></TextBlock>
                            <TextBlock Text=" | "></TextBlock>
                            <TextBlock Text="Жанр: "></TextBlock>
                            <TextBlock Text="{Binding Genre}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Автор: "></TextBlock>
                            <TextBlock Text="{Binding Author}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Цена: "></TextBlock>
                            <TextBlock Text="{Binding Cost}"></TextBlock>
                            <TextBlock Text="руб."></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Количество в магазине: "></TextBlock>
                            <TextBlock Text="{Binding CheckCountStore}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Количество в магазине: "></TextBlock>
                            <TextBlock Text="{Binding CheckCountStock}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Описание: "></TextBlock>
                            <TextBlock Text="{Binding Description}" TextWrapping="Wrap" MaxWidth="400px"></TextBlock>
                        </StackPanel>
                        <Button Name="btnAddBok" Content="Добавить в корзину" Uid="{Binding id}" Click="btnAddBok_Click"></Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </DataTemplate>
    </Page.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="101*"/>
            <RowDefinition Height="349*"/>
        </Grid.RowDefinitions>
        <Border BorderBrush="Black" BorderThickness="1,1,1,1" HorizontalAlignment="Left" Margin="634,0,0,0" Width="166">
            <StackPanel Grid.Row="0"  HorizontalAlignment="Right">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Количество выбранных книг: "></TextBlock>
                    <TextBlock Name="tbCount"></TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal" >
                    <TextBlock Text="Стоимость покупки: "></TextBlock>
                    <TextBlock Name="tbPrice"></TextBlock>
                    <TextBlock Text=" "></TextBlock>
                    <TextBlock Name="tbSalePrice"></TextBlock>
                    <TextBlock Text=" руб." Name="tbRub"></TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal" >
                    <TextBlock Text="Размер скидки: "></TextBlock>
                    <TextBlock Name="tbSale"></TextBlock>
                    <TextBlock Text=" %" Name="tbPer"></TextBlock>
                </StackPanel>
                <Button Name="btnGoCart" Content="Корзина" Click="btnGoCart_Click"></Button>
            </StackPanel>
        </Border>
        <ListBox Name="lbBooks" ItemTemplate="{StaticResource outputBooks}" Grid.Row="1"></ListBox>
    </Grid>
</Page>
