<Page x:Class="Exam19Apr.pgTrash"
      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:Exam19Apr"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="pgTrash">
    <Page.Resources>
        <DataTemplate x:Key="outputBooks">
            <Border BorderBrush="Black" BorderThickness="1,1,1,1">
                <StackPanel Orientation="Horizontal" Width="600px">
                    <StackPanel>
                        <Image Source="{Binding Image}" Width="100px" Height="100px"></Image>
                    </StackPanel>
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Название: "></TextBlock>
                            <TextBlock Text="{Binding Heading}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Автор: "></TextBlock>
                            <TextBlock Text="{Binding Writer}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Количество: "></TextBlock>
                            <TextBox Text="{Binding FullCount}" TextChanged="TextBox_TextChanged" Uid="{Binding id}"></TextBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Цена: "></TextBlock>
                            <TextBlock Name="tbCost" Text="{Binding Price}" TextDecorations="{Binding DecorationPrice}"></TextBlock>
                            <TextBlock Text=" "></TextBlock>
                            <TextBlock Text="{Binding PriceSale}" Visibility="{Binding VisiblePriceSale}"></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="lbBooksBuy" ItemTemplate="{StaticResource outputBooks}" Grid.Row="0"></ListBox>
        <StackPanel Orientation="Horizontal"  Grid.Row="1">
            <Button Name="btnBuy" Content="Купить" Width="40px" Click="btnBuy_Click"></Button>
            <Button Name="btnDel" Content="Очистить" Width="40px" Click="btnDel_Click"></Button>
            <Button Name="btnBack" Click="btnBack_Click" Content="Назад"></Button>
        </StackPanel>
    </Grid>
</Page>
