<Page x:Class="Books_Shop_Kopey.Pages.Shop"
      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:Books_Shop_Kopey.Pages"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Shop" IsVisibleChanged="Page_IsVisibleChanged">

    <Page.Resources>

        <Style x:Key="TextBD">
            <Setter Property="Control.FontSize" Value="10" />
            <Setter Property="Control.Foreground" Value="Black" />
            <Setter Property="Control.IsEnabled" Value="False" />
        </Style>
        <Style x:Key="Border">
            <Setter Property="Control.BorderBrush" Value="#FF444242" />
            <Setter Property="Control.OpacityMask" Value="#FF939393" />
            <Setter Property="Control.BorderThickness" Value="1" />
            <Setter Property="Control.Margin" Value="2" />
        </Style>
    </Page.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="43*"/>
            <RowDefinition Height="407*"/>
        </Grid.RowDefinitions>
        <Button x:Name="Dob" Grid.Row="0" Click="Dob_Click">Оформить заказ</Button>
        <ListView x:Name="list"  HorizontalContentAlignment="Stretch"  ItemsSource="{Binding Path=DataListGet2, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <UniformGrid Columns="1" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Border Style="{StaticResource Border}"  >
                        <StackPanel Background="{x:Null}" HorizontalAlignment="Stretch" Orientation="Horizontal">
                            <Border Style="{StaticResource Border}">
                                <Image  Width="140" Height="140" Source="{Binding image}" x:Name="IMG" Stretch="Uniform"/>
                            </Border>

                            <StackPanel Background="{x:Null}" Style="{StaticResource TextBD}" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left"  Margin="1">
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock Margin="5 0 5 0">Название книги:</TextBlock>

                                    <TextBlock  Height="20" TextWrapping="Wrap" x:Name="Name"   Text="{Binding name_books}"/>
                                 


                                </StackPanel>
                                <StackPanel Orientation="Horizontal" >

                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Margin="5 0 5 0">Автор:</TextBlock>
                                    <TextBlock  Height="20"  x:Name="aut"  Text="{Binding autor}"/>

                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Height="20"  Margin="5 0 5 0" Text="Количество"></TextBlock>
                                    <TextBlock Height="20"  TextWrapping="Wrap" x:Name="Coг"  Text="{Binding count}"/>
                                    <TextBlock Height="20"  Margin="5 0 5 0" Text="шт."></TextBlock>

                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Margin="5 0 5 0">Цена:</TextBlock>
                                    <TextBlock  Height="20"  x:Name="Cost"  Text="{Binding cost, ValidatesOnExceptions=True, StringFormat={}{0:F0} руб.}"/>


                                </StackPanel>


                            </StackPanel>
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ListView>
    </Grid>
</Page>
