<Page x:Class="Nastya.Pages.ServicesPage"
      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:Nastya.Pages"
      mc:Ignorable="d" 
      Loaded="Page_Loaded"
      d:DesignHeight="450" d:DesignWidth="800"
      Title="Список услуг">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
            <ComboBox Margin="5" Width="150"
                                          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="TBoxSearch" Width="150" Margin="5"
                                         TextChanged="TBoxSearch_TextChanged"></TextBox>
        </StackPanel>
        <ListView Grid.Row="2" x:Name="LViewServices">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Border BorderBrush="#ACE5EE" 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"
                                       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"></Button>
                                    <Button Content="Удалить" Name="BtnDelete" Click="BtnDelete_Click"></Button>
                      </StackPanel>
                   </StackPanel>
                   </Grid>
                  </Border>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

        <Button Grid.Row="3" HorizontalAlignment="Left" Name="BtnAddService" Click="BtnAddService_Click" Content="Добавить услугу" Margin="671,0,0,0" Background="#E4717A" Width="129"></Button>
    </Grid>
</Page>
