<Page x:Class="Agents.Main"
      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:Agents"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Main" Margin="20,0,0,0" FontFamily="Monotype Corsiva" FontSize="15">
    <Page.Resources>
        <DataTemplate x:Key="DT1">
            <StackPanel Orientation="Horizontal" Width="800" Height="130" Margin="10">
                <Image Source="{Binding Logo}" Width="80" Height="80" HorizontalAlignment="Left"/>
                <StackPanel Margin="10" HorizontalAlignment="Left" VerticalAlignment="Center">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding AgentType.Title}" FontFamily="Monotype Corsiva"/>
                        <TextBlock Text=" | " FontFamily="Monotype Corsiva"/>
                        <TextBlock Text="{Binding Title}" FontFamily="Monotype Corsiva"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding ProductSale.ProductCount}" FontFamily="Monotype Corsiva"/>
                        <TextBlock Text="продаж за год" FontFamily="Monotype Corsiva"/>
                    </StackPanel>
                    <StackPanel>
                        <TextBlock Text="{Binding Phone}" FontFamily="Monotype Corsiva"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Приоритетность: " FontFamily="Monotype Corsiva"/>
                        <TextBlock Text="{Binding Priority}" FontFamily="Monotype Corsiva"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button x:Name="btnRed" Content="Редактировать" HorizontalAlignment="Center" Width="400" Height="20" Margin="5" Click="btnRed_Click" Background="#FFC4FAFD"/>
                    </StackPanel>
                </StackPanel>
                <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" >
                    <TextBlock Text="10%" VerticalAlignment="Center" HorizontalAlignment="Right" FontSize="20"/>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="9*"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <ListBox x:Name="listbox" ItemTemplate="{StaticResource DT1}" Grid.Row="1"/>
        <TextBox x:Name="txtBox" Width="300" Height="30" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="10" TextChanged="txtBox_TextChanged"/>
        <ComboBox Name="cmbBox" Width="200" Height="30" VerticalAlignment="Bottom" Margin="60,10,10,10" SelectionChanged="cmbBox_SelectionChanged_1" >
            <ComboBoxItem Content="Наименование(по возрастанию)"/>
            <ComboBoxItem Content="Наименование(по убыванию)"/>
            <ComboBoxItem Content="Размер скидки(по возрастанию)"/>
            <ComboBoxItem Content="Размер скидки(по убыванию)"/>
            <ComboBoxItem Content="Приоритет агента(по возрастанию)"/>
            <ComboBoxItem Content="Приоритет агента(по убыванию)"/>
        </ComboBox>
        <ComboBox Name="cmbBox1" Width="200" Height="30" VerticalAlignment="Bottom" Margin="495,10,10,10" SelectionChanged="cmbBox_SelectionChanged" Tag="{Binding ID}"/>
        <Button x:Name="btnDob" Content="Добавить агента" Grid.Row="2" Width="120" Height="25" Click="btnDob_Click" Background="#FFC4FAFD"/>
    </Grid>
</Page>
