<Window x:Class="wpf_app.Model.Windows.ProductDetailsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:wpf_app.Model.Windows"
        mc:Ignorable="d"
        Title="{Binding WindowTitle}" Height="400" Width="700">

    <Window.Resources>
        <BitmapImage
            x:Key='defaultImage'
            UriSource="./img/defaultPicture.jpg"/>
    </Window.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>

        <Border
            Grid.Row="0"
            Grid.RowSpan="3"
            BorderBrush="Black"
            BorderThickness="2"
            CornerRadius="5"
            Margin="5 5 5 5">
            <Image
            Source="{Binding ImageBitmap, TargetNullValue={StaticResource defaultImage}}"
                Stretch="Fill"/>
        </Border>

        <TextBlock
            Grid.Column="1"
            Margin="20 0 0 0"
            FontSize="25">
                <Run Text="{Binding Category}"/>
                <Run Text="{Binding Company}"/>
                <Run Text="{Binding Title}"/>
        </TextBlock>

        <StackPanel
            Grid.Column="1"
            Grid.Row="1"
            TextElement.FontSize="15"
            Margin="20 0 0 0">
            <TextBlock Text="Категория товара: ">
                <Run Text="{Binding Category}"/>
            </TextBlock>
            <TextBlock Text="Компания: ">
                <Run Text="{Binding Company}"/>
            </TextBlock>
            <TextBlock Text="Название товара: ">
                <Run Text="{Binding Title}"/>
            </TextBlock>
            <TextBlock Text="Оценка покупателей: ">
                <Run Text="{Binding Rating}"/>
            </TextBlock>
            <TextBlock Text="Дата поступления: ">
                <Run Text="{Binding ArrivalDate}"/>
            </TextBlock>
            <TextBlock Text="{Binding ExistenceStringS}"/>
            <TextBlock Text="Цена: ">
                <Run Text="{Binding Price}"/>
            </TextBlock>
        </StackPanel>

        <Button
            x:Name="ExitButton"
            Grid.Column="1"
            Grid.Row="2"
            Width="150"
            VerticalAlignment="Center"
            HorizontalAlignment="Right"
            Margin="10"
            IsCancel="True"
            Content="Закрыть"
            Click="ExitButton_Click"/>
    </Grid>
</Window>
