<Page x:Class="ExamBoldin.pgBasket"
      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="pgBasket">

    <Page.Resources>
        <DataTemplate x:Key="outputBooks">
            <Border BorderBrush="Black" BorderThickness="1,1,1,1">
                <StackPanel Orientation="Horizontal" Width="600px">
                    <StackPanel>
                        <Image Source="{Binding Cover}" Width="100px" Height="100px"></Image>
                    </StackPanel>
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Название: "></TextBlock>
                            <TextBlock Text="{Binding Name}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Автор: "></TextBlock>
                            <TextBlock Text="{Binding Author}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Количество: "></TextBlock>
                            <TextBox Text="{Binding AllCount}" TextChanged="TextBox_TextChanged" Uid="{Binding id}"></TextBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Цена: "></TextBlock>
                            <TextBlock Name="tbCost" Text="{Binding Cost}" TextDecorations="{Binding DecorCost}"></TextBlock>
                            <TextBlock Text=" "></TextBlock>
                            <TextBlock Text="{Binding CostSale}" Visibility="{Binding VisibleCostSale}"></TextBlock>
                            <TextBlock Text=" руб."></TextBlock>
                        </StackPanel>
                        <Button Name="btnDeleteBook" Content="Удалить" Click="btnDeleteBook_Click" Uid="{Binding id}"></Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </DataTemplate>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="4*"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <ListBox Name="lbBooksBasket" ItemTemplate="{StaticResource outputBooks}" Grid.Row="0"></ListBox>
        <StackPanel Orientation="Horizontal"  Grid.Row="1" HorizontalAlignment="Center">
            <Button Name="btnBuy" Content="Купить" Width="40px" Click="btnBuy_Click"></Button>
            <Button Name="btnDel" Content="Очистить" Width="60px" Click="btnDel_Click"></Button>
            <Button Name="btnBack" Click="btnBack_Click" Content="Назад"></Button>
        </StackPanel>
    </Grid>
</Page>
