
<Window x:Class="WpfApp2.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:WpfApp2"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Window.Resources>
        <BitmapImage 
        x:Key='defaultImage' 
        UriSource='C:\Users\User\Desktop\WpfApp1\WpfApp1\bin\Debug\net8.0-windows\img\pornGirl.jpg' />
    </Window.Resources>
    <Grid ShowGridLines="True">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition />
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        
        

        <Image 
            
        Source="3.jpg" 
        Grid.RowSpan="2" HorizontalAlignment="Left"/>
        <ListBox
        Grid.Column="1"
Grid.Row="1"
Background="White"
ItemsSource="{Binding SparesList}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">


            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel 
        HorizontalAlignment="Center" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border 
        BorderThickness="1" 
        BorderBrush="Black" 
        CornerRadius="5">
                        <Grid 
                        Width="200"
Margin="10" 
HorizontalAlignment="Stretch">

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="auto"/>
                            </Grid.ColumnDefinitions>
                            <Image
Width="64" 
Height="64"
Source="{Binding ImageBitmap}" />
                            <StackPanel
Grid.Column="1"
Margin="5"
Orientation="Vertical">

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

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

                            </StackPanel>
                            <TextBlock 
Grid.Column="2"
Text="{Binding price}"/>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>

        </ListBox>
        <StackPanel 
        Orientation="Vertical"
        Grid.RowSpan="3"
        VerticalAlignment="Bottom">
            <Button 
            x:Name="ExitButton"
            Content="Выход" 
            Click="ExitButton_Click"
            Height="50"/>
        </StackPanel>

        <WrapPanel
            
        Orientation="Horizontal"
        Grid.Column="1"
        MinHeight="50">

            <Label 
    Content="Деталь:"
    VerticalAlignment="Center"/>



            <ComboBox
                
    Name="DetailFilterComboBox"
    SelectionChanged="DetailFilterComboBox_SelectionChanged_1"
    VerticalAlignment="Center"
    MinWidth="100"
    SelectedIndex="0"
    ItemsSource="{Binding SparesDetailList}">


                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Label 
                Content="{Binding title}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <Label 
Content="Цена:"
VerticalAlignment="Center"/>
            <ComboBox
Name="PriceFilterComboBox"
SelectionChanged="PriceFilterComboBox_SelectionChanged_2"
VerticalAlignment="Center"
MinWidth="100"
SelectedIndex="0"
ItemsSource="{Binding SparesPriceList}">

                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Label 
            Content="{Binding title}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <Label 
Content="Тип ТС"
VerticalAlignment="Center"/>
            <ComboBox
Name="TypeFilterComboBox"
SelectionChanged="TypeFilterComboBox_SelectionChanged_3"
VerticalAlignment="Center"
MinWidth="100"
SelectedIndex="0"
ItemsSource="{Binding SparesTypeList}">

                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Label 
            Content="{Binding title}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <RadioButton
    GroupName="Price"
    Tag="2"
    Content="Дороже"
    Checked="RadioButton_Checked"
    VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
            <RadioButton
    GroupName="Price"
    Tag="1"
    Content="Дешевле"
    IsChecked="True"
    Checked="RadioButton_Checked"
    VerticalAlignment="Center" Height="15" Width="69"/>
            <Label 
    Content="Искать" 
    VerticalAlignment="Center"/>
            <TextBox
    Width="200"
    VerticalAlignment="Center"
    x:Name="SearchFilterTextBox" 
    KeyUp="SearchFilter_KeyUp"/>
        </WrapPanel>
    </Grid>
</Window>
