<Page x:Class="DemoPractick.Pages.Users.Products"
      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:DemoPractick.Pages.Users"
      mc:Ignorable="d" 
      d:DesignHeight="500" d:DesignWidth="800" 
      Title="Product" >
    <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 Background="#B0E5FD">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="269*"/>
            <ColumnDefinition Width="261*"/>
            <ColumnDefinition Width="270*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="66*"/>
            <RowDefinition Height="31*"/>
            <RowDefinition Height="372*"/>
            <RowDefinition Height="31*"/>
        </Grid.RowDefinitions>

        <Viewbox VerticalAlignment="Center" Grid.Column="0" Grid.ColumnSpan="1" Height="66" >
            <TextBox  x:Name="Poisk"  MouseEnter="Poisk_Enter" TextWrapping="Wrap"  MaxHeight="66" MinWidth="200" Margin="4,15,4,18"></TextBox>
        </Viewbox>
        <Viewbox VerticalAlignment="Center" Grid.Column="1" Grid.ColumnSpan="1" Height="66" >
            <ComboBox x:Name="Sort" MouseEnter="Sort_Enter" MaxHeight="66" MinWidth="185"  IsEditable="True" Margin="4,14,4,14">
                <ComboBoxItem>Наименование (По возростанию)</ComboBoxItem>
                <ComboBoxItem>Номер цеха (По возростанию)</ComboBoxItem>
                <ComboBoxItem>Минимальная стоимость для агента (По возростанию)</ComboBoxItem>
                <ComboBoxItem>Наименование (По убыванию)</ComboBoxItem>
                <ComboBoxItem>Номер цеха (По убыванию)</ComboBoxItem>
                <ComboBoxItem>Минимальная стоимость для агента (По убыванию)</ComboBoxItem>
            </ComboBox>
        </Viewbox>
        <Viewbox VerticalAlignment="Center" Grid.Column="2" Height="66" >
            <ComboBox x:Name="Filtr" MouseEnter="Filtr_Enter" MaxHeight="66" MinWidth="185" IsEditable="True" ItemsSource="{Binding TypeProduct}" Margin="4,14,4,14"></ComboBox>
        </Viewbox>


        <ListView x:Name="list"  HorizontalContentAlignment="Stretch" Grid.Row="2" ItemsSource="{Binding Path=DataListGet, UpdateSourceTrigger=PropertyChanged}"  Grid.ColumnSpan="3">
            <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"  Margin="1">
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock  Height="20"   TextWrapping="Wrap"   Text="{Binding Path = ProductType.Title}"/>
                                    <TextBlock  Height="20"   TextWrapping="Wrap"   Text="|"/>
                                    <TextBlock  Height="20"   TextWrapping="Wrap"  Text="{Binding Title}"/>
                                </StackPanel>
                                <TextBlock  Height="20"   Text="{Binding ArticleNumber}"/>
                                <StackPanel Orientation="Horizontal"    >
                                    <TextBlock Height="36" Text="Материалы: "></TextBlock>
                                    <TextBlock  Height="36"  TextWrapping="Wrap"  Text="{Binding MaterialType}" Width="300"/>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Height="20" Text="Стоимость: "></TextBlock>
                                    <TextBlock Height="20" TextWrapping="Wrap"  Text="{Binding Cena}"/>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ListView>
        <StackPanel Orientation="Horizontal"  HorizontalAlignment="Stretch"  VerticalAlignment="Center" Background="White" Grid.Row="1" Grid.ColumnSpan="3" Height="36">
            <Button Content="+ Товары" Click="PlusTovar"  Height="25"   BorderBrush="#B0E5FD" BorderThickness="1" Background="{x:Null}" Margin="300,0,0,0"></Button>
            <Button Content="Редактирование" Click="RedTovar" Height="25"  BorderBrush="#B0E5FD"  BorderThickness="1"   Background="{x:Null}"></Button>
        </StackPanel>
        <StackPanel Orientation="Horizontal" Style="{StaticResource TextBD}" Background="#B0E5FD" HorizontalAlignment="Stretch"  VerticalAlignment="Stretch"  Margin="5,0,0,0" Grid.Row="3" Grid.ColumnSpan="3" Height="20" >
            <TextBlock Height="20" Text="{Binding GetunstaticEqu}"/>
            <TextBlock Height="20" Text=" из "/>
            <TextBlock Height="20" Text="{Binding GetstaticEqu}"/>
        </StackPanel>

    </Grid>
</Page>
