<Page x:Class="WpfAppProduct.PageList"
      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:WpfAppProduct"
      mc:Ignorable="d" 
      d:DesignHeight="850" d:DesignWidth="1200"
      Title="PageList">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="5*"/>
            <RowDefinition Height="70"/>
        </Grid.RowDefinitions>
        <TextBlock Text="Продукты" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        <ListView Name="LvProduct" Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Border BorderThickness="1" BorderBrush="Black" CornerRadius="1">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="2*"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="150"/>
                            </StackPanel>
                            <StackPanel Grid.Column="1">
                                <TextBlock Text="{Binding ProductName}" FontSize="14" FontFamily="Arial"/>
                                <TextBlock Text="{Binding Desc}" FontSize="14" FontFamily="Arial"/>
                                <TextBlock Text="{Binding Price}" FontSize="14" FontFamily="Arial"/>
                            </StackPanel>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListView.ItemTemplate>
            <ListView.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Добавить в корзину" Click="MenuItem_Click" FontSize="14" FontFamily="Arial" Uid="{Binding ProductName}"/>
                </ContextMenu>
            </ListView.ContextMenu>
        </ListView>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button Name="BtnBasket" Content="Просмотр корзины" Visibility="Collapsed" Width="150" Height="30" FontSize="14" Click="BtnBasket_Click"/>
        </Grid>
    </Grid>
</Page>
