<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
        x:Class="DemoService.ServiceWindow"
		x:CompileBindings="False"
        Title="Сервис «Подай на 16»"
		WindowStartupLocation="CenterScreen"
		Width="800" Height="600">
	<StackPanel Orientation="Vertical"
				Margin="10">
		<Grid RowDefinitions="Auto"
			  ColumnDefinitions="* Auto Auto"
			  Margin="0 0 0 10">
			<TextBox Name="SearchTextBox"
					 Grid.Column="0"
					 KeyUp="SearchTextBox_KeyUp"
					 Watermark="Поиск"
					 Margin="0 0 10 0"/>
			<ComboBox Name="SortComboBox"
					  Grid.Column="1"
					  SelectionChanged="SortComboBox_SelectionChanged"
					  Margin="0 0 10 0">
				<ComboBoxItem>Не сортировать</ComboBoxItem>
				<ComboBoxItem>По возрастанию</ComboBoxItem>
				<ComboBoxItem>По убыванию</ComboBoxItem>
			</ComboBox>
			<ComboBox Name="FilterComboBox"
					  Grid.Column="2"
					  SelectionChanged="FilterComboBox_SelectionChanged">
				<ComboBoxItem>Все</ComboBoxItem>
				<ComboBoxItem>От 0% до 5%</ComboBoxItem>
				<ComboBoxItem>От 5% до 15%</ComboBoxItem>
				<ComboBoxItem>От 15% до 30%</ComboBoxItem>
				<ComboBoxItem>От 30% до 70%</ComboBoxItem>
				<ComboBoxItem>От 70% до 100%</ComboBoxItem>
			</ComboBox>
		</Grid>
		<Button Name="AddButton"
				Click="AddButton_Click"
				HorizontalAlignment="Center"
				Margin="0 0 0 10"
				Background="#ff9c1a"
				BorderBrush="Chocolate"
				BorderThickness="1">
			Добавить услугу
		</Button>
		<ScrollViewer>
			<ListBox Name="ServicesListBox"
					 MaxHeight="500"
					 BorderBrush="Gray"
					 BorderThickness="1">
				<ListBox.ItemTemplate>
					<DataTemplate>
						<Border BorderBrush="Gray"
								BorderThickness="1"
								Margin="-6 -3 -6 -11">
							<DockPanel Margin="5">
								<Image DockPanel.Dock="Left"
									   Source="{Binding MainImagePathBitmap}"
									   Height="100" Width="100"
									   Margin="10 0 15 0"/>
								<StackPanel Orientation="Horizontal"
											DockPanel.Dock="Bottom">
									<Button Name="EditButton"
											Tag="{Binding Id}"
											Click="EditButton_Click"
											Background="#ff9c1a"
											BorderBrush="Chocolate"
											BorderThickness="1"
											Margin="0 0 5 0">
										редактировать
									</Button>
									<Button Name="DeleteButton"
											Tag="{Binding Id}"
											Click="DeleteButton_Click"
											Background="#ff9c1a"
											BorderBrush="Chocolate"
											BorderThickness="1">
										удалить
									</Button>
								</StackPanel>
								<StackPanel Orientation="Vertical">
									<TextBlock Name="ServiceName"
									   Text="{Binding Title}"
									   Margin="0 0 0 5"/>
									<TextBlock Margin="0 0 0 3">
										<Run Name="PreviousCost"/>
										<Run Name="ActualCost"
											 Text="{Binding Cost}"/>
										<Run Text="рублей за"/>
										<Run Name="Time"
											 Text="{Binding DurationInSeconds}"/>
										<Run Text="минут"/>
									</TextBlock>
									<TextBlock FontSize="12">
										<Run Text="* скидка"/>
										<Run Name="Discount"
											 Text="{Binding Discount}"/>
									</TextBlock>
								</StackPanel>
							</DockPanel>
						</Border>
					</DataTemplate>
				</ListBox.ItemTemplate>
			</ListBox>
		</ScrollViewer>
		<ScrollViewer>
			<ListBox Name="UserServicesListBox"
					 MaxHeight="540"
					 BorderBrush="Gray"
					 BorderThickness="1">
				<ListBox.ItemTemplate>
					<DataTemplate>
						<Border BorderBrush="Gray"
								BorderThickness="1"
								Margin="-6 -3 -6 -11">
							<DockPanel Margin="5">
								<Image DockPanel.Dock="Left"
									   Source="{Binding MainImagePathBitmap}"
									   Height="100" Width="100"
									   Margin="10 0 15 0"/>
								<StackPanel Orientation="Vertical"
											VerticalAlignment="Center">
									<TextBlock Name="ServiceName"
									   Text="{Binding Title}"
									   Margin="0 0 0 5"/>
									<TextBlock Margin="0 0 0 3">
										<Run Name="PreviousCost"/>
										<Run Name="ActualCost"
											 Text="{Binding Cost}"/>
										<Run Text="рублей за"/>
										<Run Name="Time"
											 Text="{Binding DurationInSeconds}"/>
										<Run Text="минут"/>
									</TextBlock>
									<TextBlock FontSize="12">
										<Run Text="* скидка"/>
										<Run Name="Discount"
											 Text="{Binding Discount}"/>
									</TextBlock>
								</StackPanel>
							</DockPanel>
						</Border>
					</DataTemplate>
				</ListBox.ItemTemplate>
			</ListBox>
		</ScrollViewer>
	</StackPanel>
</Window>
