<Page x:Class="ProbnikDemo.PgListAgent"
      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:ProbnikDemo"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="1300"
      Title="PgListAgent">
    <Page.Resources>
        <DataTemplate x:Key="DT">
            <Border BorderBrush="Black" BorderThickness="1" Width="1200">
                <StackPanel Orientation="Horizontal" Uid="{Binding ID}" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown">
                    <Image Source="{Binding Logo}" Width="100" Height="100"></Image>
                    <StackPanel Orientation="Vertical">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding AgentTypes}"></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>
                    <TextBlock Text="{Binding MySale}"></TextBlock>
                </StackPanel>
            </Border>

        </DataTemplate>
    </Page.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="31*"/>
            <RowDefinition Height="106*"/>
            <RowDefinition Height="13*"/>
        </Grid.RowDefinitions>
        
        <ListBox Grid.Row="1"  x:Name="ListAgents" ItemTemplate="{StaticResource DT}"></ListBox>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <GroupBox Header="Поиск" Width="200" Height="50">
                <TextBox  x:Name="TBFtind" TextChanged="Filter" ></TextBox>
            </GroupBox>

            <GroupBox Header="Сотритровка" Width="200" Height="50">
                <ComboBox x:Name="ComboSort" SelectionChanged="Filter" >
                    <ComboBoxItem> Наименование (По возрастанию)</ComboBoxItem>
                    <ComboBoxItem>Наименование (По убыванию)</ComboBoxItem>
                    <ComboBoxItem>Приоритет (По возрастанию)</ComboBoxItem>
                    <ComboBoxItem>Приоритет (По убыванию)</ComboBoxItem>
                    
                </ComboBox>
            </GroupBox>
            <GroupBox Header="Фильтр"  Width="200" Height="50">
                <ComboBox  x:Name="ComboFilter" SelectionChanged="Filter">
                

                </ComboBox>
            </GroupBox>
            <Button x:Name="BtnGoAdd" Click="BtnGoAdd_Click" Content="Добавить агента" Width="150" Height="30"></Button>
        </StackPanel>
    </Grid>
</Page>
