<Page x:Class="Exam19.Pages.Staf"
      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:Exam19.Pages"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Staf">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
        </Grid.RowDefinitions>
        <ListView Grid.Row="2" x:Name="LViewServices" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <ListView.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Horizontal" HorizontalAlignment="Center"></WrapPanel>
                </ItemsPanelTemplate>
            </ListView.ItemsPanel>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Border BorderBrush="Orange" CornerRadius="15" Padding="5" Background="{Binding BackColor}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="100"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Row="1" Width="auto" FontWeight="Bold" x:Name="BlockRecords"></TextBlock>
                            <Image Source="{Binding MainImage}"></Image>
                            <StackPanel Grid.Column="1">
                                <TextBlock Width="auto" Text="{Binding Title}" HorizontalAlignment="Left"></TextBlock>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Width="auto" Text="{Binding Cost, StringFormat=N2}" Visibility="{Binding DiscountVisibility}" TextDecorations="Strikethrough"></TextBlock>
                                    <TextBlock Width="auto" Text="{Binding TotalCost}"></TextBlock>
                                </StackPanel>
                                <TextBlock Width="auto" FontSize="12" Text="{Binding DiscountText}" Visibility="{Binding DiscountVisibility}" HorizontalAlignment="Left"></TextBlock>
                                <StackPanel Orientation="Horizontal">
                                    <Button Content="Редактировать" Name="BtnEdit" Click="BtnEdit_Click" Visibility="{Binding AdminControlsVisibility}"></Button>
                                    <Button Content="Удалить" Name="BtnDelete" Click="BtnDelete_Click" Visibility="{Binding AdminControlsVisibility}"></Button>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <Button Grid.Row="3" HorizontalAlignment="Left" Name="BtnAddService" Click="BtnAddService_Click" Content="Добавить сотрудника" FontSize="15" Background="#b8c0ff" Height="50" Margin="618,0,0,0" VerticalAlignment="Center" Width="182"></Button>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
            <ComboBox Margin="5" Width="150" x:Name="ComboSortBy" SelectionChanged="ComboSortBy_SelectionChanged">
                <ComboBoxItem Content="По возрастанию"></ComboBoxItem>
                <ComboBoxItem Content="По убыванию"></ComboBoxItem>
            </ComboBox>
            <ComboBox Margin="5" Width="150" x:Name="ComboDiscount" SelectionChanged="ComboDiscount_SelectionChanged">
                <ComboBoxItem Content="Все"></ComboBoxItem>
                <ComboBoxItem Content="От 0 до 5 %"></ComboBoxItem>
                <ComboBoxItem Content="От 5 до 15 %"></ComboBoxItem>
                <ComboBoxItem Content="От 15 до 30 %"></ComboBoxItem>
                <ComboBoxItem Content="От 30 до 70 %"></ComboBoxItem>
                <ComboBoxItem Content="От 70 до 100 %"></ComboBoxItem>
            </ComboBox>
            <TextBox x:Name="TBoxSearh" Width="150" Margin="5" TextChanged="TBoxSearh_TextChanged"></TextBox>
        </StackPanel>
    </Grid>
</Page>
