<Page x:Class="WpfApp1.YourBasket"
      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:WpfApp1"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="YourBasket" DataContext ="{Binding RelativeSource={RelativeSource Mode=Self}}">
    <Page.Resources>
        <DataTemplate x:Key="ListBookBasket">
            <Border BorderBrush="Black" BorderThickness="1" Width="1700">
                <StackPanel Uid="{Binding IdBook}" Orientation="Horizontal">
                    <Image Height="100" Source="{Binding Image}"></Image>
                    <StackPanel Orientation="Vertical">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Название: "></TextBlock>
                            <TextBlock Text="{Binding Title}"/>
                            <TextBlock Text=" | Жанр: "></TextBlock>
                            <TextBlock Text="{Binding Genres.GenreName}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Автор: "></TextBlock>
                            <TextBlock Text="{Binding Authors.Name}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Visibility="{Binding Visible}">
                            <TextBlock Text="Цена: "></TextBlock>
                            <TextBlock Text="{Binding Cost, StringFormat=0}" />
                            <TextBlock Text=" руб."/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Количество: "></TextBlock>
                            <Button x:Name="Plus" Uid="{Binding IdBook}" Content="+" Click="Plus_Click"/>
                            <TextBlock Text="{Binding CountInBasket}"/>
                            <Button x:Name="Minus" Uid="{Binding IdBook}" Content="-" Click="Minus_Click"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Цена: "></TextBlock>
                            <TextBlock Text="{Binding TotalPriseOrder, StringFormat=0}" TextDecorations="{Binding newDecoration}" Visibility="{Binding Visible2}"/>
                            <TextBlock Text=" "/>
                            <TextBlock Text="{Binding TotalPriseOrderWithSale, StringFormat=0}"/>
                            <TextBlock Text=" руб."/>
                        </StackPanel>
                    </StackPanel>
                    <Button x:Name="Delit" Content="Удалить позицию" Click="Delit_Click" Uid="{Binding IdBook}"></Button>
                </StackPanel>
            </Border>
        </DataTemplate>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="209*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <Button Content="На главную" Name="MainPage" Height="25"  Click="MainPage_Click"></Button>
            <Button Content="Оформить заказ" Name="Order" Height="25" Click="Order_Click" Margin="20,0,20,0"></Button>
            <Button Content="Очичтить корзину" Name="Clear" Height="25" Click="Clear_Click"></Button>
        </StackPanel>
        <ListBox x:Name="ListBasket" ItemTemplate="{StaticResource ListBookBasket}" Grid.Row="1" Visibility="Visible"></ListBox>
        <StackPanel x:Name="Info" Grid.Row="1" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center">
            <TextBlock x:Name="number"></TextBlock>
            <TextBlock x:Name="dateOrder"></TextBlock>
            <TextBlock x:Name="DateRezerv"></TextBlock>
            <TextBlock x:Name="totalCostOrder"></TextBlock>
            <TextBlock x:Name="totalCostSaleOrder"></TextBlock>
            <TextBlock x:Name="totalCostWithSaleOrder"></TextBlock>
            <TextBlock x:Name="totalCount"></TextBlock>
        </StackPanel>
    </Grid>
</Page>
