<Page x:Class="Demoexample.Agents"
      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:Demoexample"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Agents">
    <Page.Resources>
        <DataTemplate x:Key="AllAgent">
            <Border BorderBrush="Black" BorderThickness="1" Margin="0,0,0,10" Width="700" Height="100">
                <StackPanel Orientation="Horizontal" Uid="{Binding ID}" Background="{Binding Color}" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown">
                    <Image Width="100" Height="100" Source="{Binding Logo}"></Image>
                    <StackPanel Orientation="Vertical" Width="570">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock x:Name="TBType" Text="{Binding TypeOfAgent}"></TextBlock>
                            <TextBlock Text=" | "></TextBlock>
                            <TextBlock x:Name="Name" Text="{Binding Title}"></TextBlock>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock x:Name="Count" Text="{Binding Count}"></TextBlock>
                            <TextBlock Text=" продаж за год"></TextBlock>
                        </StackPanel>
                        <TextBlock x:Name="Phone" Text="{Binding Phone}"></TextBlock>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Приоритетность: "></TextBlock>
                            <TextBlock x:Name="Priority" Text="{Binding Priority}"></TextBlock>
                        </StackPanel>
                    </StackPanel>
                    <TextBlock x:Name="Sale" Text="{Binding Sale}"></TextBlock>
                    <TextBlock Text=" %"></TextBlock>
                </StackPanel>
            </Border>
        </DataTemplate>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="77*"/>
            <RowDefinition Height="373*"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
            <TextBox Height="50" Width="150" Margin="0,0,10,0" x:Name="Scan" TextChanged="ChangeList"></TextBox>
            <ComboBox x:Name="Sort" SelectionChanged="ChangeList" Margin="0,0,10,0" Height="50" Width="150">
                <ComboBoxItem>По возрастанию наименования</ComboBoxItem>
                <ComboBoxItem>По убыванию наименования</ComboBoxItem>
                <ComboBoxItem>По возрастанию размера скидки</ComboBoxItem>
                <ComboBoxItem>По убыванию размера скидки</ComboBoxItem>
                <ComboBoxItem>По возрастанию приоритета</ComboBoxItem>
                <ComboBoxItem>По убыванию приоритета</ComboBoxItem>
            </ComboBox>
            <ComboBox x:Name="Filter" SelectionChanged="ChangeList" Margin="0,0,10,0" Height="50" Width="150"></ComboBox>
            <Button x:Name="newAgent" Content="Добавить нового агента" Click="newAgent_Click" Height="50" Width="150"></Button>
        </StackPanel>
        <ListBox x:Name="lbAllAgent" Grid.Row="1" ItemTemplate="{StaticResource AllAgent}"></ListBox>
    </Grid>
</Page>
