<Page x:Class="DemoTest_Boldin_41P.pgAgentList"
      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:DemoTest_Boldin_41P"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="pgAgentList">
    <Page.Resources>
        <DataTemplate x:Key="outputAgents">
            <Border BorderThickness="1,1,1,1" BorderBrush="Black" Width="600px" Height="65px">
                <StackPanel Orientation="Horizontal" Background="{Binding BorderColor}" Uid="{Binding ID}">
                    <Image Source="{Binding Logo}" Width="40px" Height="40px"></Image>
                    <StackPanel Margin="15,10,0,0">
                        <StackPanel Orientation="Horizontal" Width="520px">
                            <TextBlock Text="{Binding NameTypeAgent}"></TextBlock>
                            <TextBlock Text=" | "></TextBlock>
                            <TextBlock Text="{Binding Title}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding CountSale}"></TextBlock>
                            <TextBlock Text=" продаж за год."></TextBlock>
                        </StackPanel>
                        <TextBlock Text="{Binding Phone}"></TextBlock>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Приоритетность "></TextBlock>
                            <TextBlock Text="{Binding Priority}"></TextBlock>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal"  Margin="0,10,0,0">
                        <TextBlock Text="{Binding Sale}"></TextBlock>
                        <TextBlock Text=" %"></TextBlock>
                    </StackPanel>
                </StackPanel>

            </Border>
        </DataTemplate>
    </Page.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="60*"/>
            <RowDefinition Height="391*"/>
        </Grid.RowDefinitions>
        <ListBox Name="lbAgents" ItemTemplate="{StaticResource outputAgents}" Grid.Row="1" SelectionMode="Extended" SelectionChanged="lbAgents_SelectionChanged" MouseDoubleClick="lbAgents_MouseDoubleClick"></ListBox>
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <TextBox Text="Введите для поиска"  Width="150px" Height="40px" HorizontalAlignment="Left" MouseEnter="TextBox_MouseEnter" Name="tbFind" TextChanged="tbFind_TextChanged"></TextBox>
            <ComboBox Width="100px" Height="40px" SelectionChanged="ComboBox_SelectionChanged" Name="cbOrder">
                <ComboBoxItem>По возрастанию именования</ComboBoxItem>
                <ComboBoxItem>По убыванию именования</ComboBoxItem>
                <ComboBoxItem>По возрастанию скидки</ComboBoxItem>
                <ComboBoxItem>По убыванию скидки</ComboBoxItem>
                <ComboBoxItem>По возрастанию приоритета</ComboBoxItem>
                <ComboBoxItem>По убыванию приоритета</ComboBoxItem>
            </ComboBox>
            <ComboBox Width="100px" Height="40px" SelectionChanged="ComboBox_SelectionChanged" Name="cbFilter">
            </ComboBox>
            <Button Width="160px" Height="40px" Visibility="Collapsed" Name="btnChangePriority" Click="btnChangePriority_Click">Изменить приоритет на...</Button>
            <Button Width="160px" Height="40px" Name="btnAddAgent" Click="btnAddAgent_Click">Добавить агента</Button>
        </StackPanel>
        
    </Grid>
</Page>
