<Window x:Class="cs_mysql_connection.MainWindow"
        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:cs_mysql_connection"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Window.Resources>
        <BitmapImage 
        x:Key='defaultImage' 
        UriSource='./img/tire_0.jpg' />
    </Window.Resources>
    <ListBox
    ItemsSource="{Binding ProductList}"
    ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
>
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel 
                HorizontalAlignment="Center" />
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>

        <ListBox.ItemTemplate>
            <DataTemplate>
                <Border 
            BorderThickness="1" 
            BorderBrush="Black" 
            CornerRadius="5">

                    <Grid 
    Margin="10" 
    HorizontalAlignment="Stretch">

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="64"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>

                        <Image
    Width="64" 
    Height="64"
    Source="{Binding ImageBitmap,TargetNullValue={StaticResource defaultImage}}" />
                        <StackPanel
    Grid.Column="1"
    Margin="5"
    Orientation="Vertical">

                            <TextBlock 
        Text="{Binding Title}"/>

                            <TextBlock 
        Text="{Binding ArticleNumber}"/>
                        </StackPanel>
                        <TextBlock 
    Grid.Column="2"
    Text="{Binding ID}"/>

                    </Grid>

                </Border>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</Window>
