<UserControl 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="450"
             x:Class="TourAgent.Views.Tours"
			 xmlns:vm="using:TourAgent.ViewModels"
			 x:DataType="vm:MainWindowViewModel"
			 Background="#878787"
			 FontFamily="{StaticResource Comic}">

	<Grid RowDefinitions="*,2.9*" >
		<StackPanel Margin="0,10,0,15" Orientation="Vertical" HorizontalAlignment="Stretch" >
			<Button HorizontalContentAlignment="Center" VerticalContentAlignment="Top" Command="{Binding ToMenu}" Content="Меню"/>
			<TextBlock Margin="0,0,10,0" HorizontalAlignment="Right" Text="{Binding StringFormat=Общая стоимость туров {0:C}, Path=ToursVM.PriceOfAll}"/>
			<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
				<TextBlock VerticalAlignment="Center" Text="Поиск: " />
				<TextBox Text="{Binding ToursVM.FindTour}" Width="300" Watermark="Поиск "></TextBox>
			</StackPanel>
			<StackPanel HorizontalAlignment="Center" Margin="0,10,0,0" Orientation="Horizontal" VerticalAlignment="Center">
				<TextBlock VerticalAlignment="Center" Text="Тип: "/>
				<ComboBox SelectedIndex="0" SelectedItem="{Binding ToursVM.SelectedItem}" ItemsSource="{Binding ToursVM.Types}" Width="300"/>
			</StackPanel>
			<StackPanel HorizontalAlignment="Center" Margin="0,10,0,0" Orientation="Horizontal" VerticalAlignment="Center">
				<TextBlock VerticalAlignment="Center" />
				<ComboBox SelectedIndex="0" SelectedItem="{Binding ToursVM.SelectedSort}" ItemsSource="{Binding ToursVM.Sort}" Width="300"/>
			</StackPanel>
			<CheckBox  IsChecked="{Binding ToursVM.CheckOrNot}" HorizontalAlignment="Center" Content="Актуальные туры"/>
		</StackPanel>
		<StackPanel Margin="150,0,0,10" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom" Grid.Row="1">
		<Button Content="Вернуться в меню" Command="{Binding ToMenu}"/>
		</StackPanel>

		<ListBox ItemsSource="{Binding ToursVM.Tours}" Grid.Row="1" Background="#878787">
			<ListBox.ItemsPanel>
				<ItemsPanelTemplate>
					<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center"/>
				</ItemsPanelTemplate>
			</ListBox.ItemsPanel>
			<ListBox.ItemTemplate>
				<DataTemplate>
					<Border HorizontalAlignment="Stretch" BorderBrush="Black"  Background="#bae3e8" BorderThickness="1" Padding="15">
						<Grid HorizontalAlignment="Stretch">
							<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical" Width="300" Height="250">
								<TextBlock FontSize="18" HorizontalAlignment="Center" Text="{Binding Name}"/>
								<Image HorizontalAlignment="Center" Width="270" Height="150" Source="{Binding GetPic}"/>
								<TextBlock FontWeight="Bold" FontSize="18" HorizontalAlignment="Center" Text="{Binding StringFormat={}{0:#} РУБ , Path=Price}"/>
								<StackPanel Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
									<StackPanel HorizontalAlignment="Left">
										<TextBlock HorizontalAlignment="Left" FontSize="15" Foreground="{Binding GetColor}" Text="{Binding GetActual}"/>
									</StackPanel>
									<StackPanel Margin="120,0,0,0" HorizontalAlignment="Right" >
										<TextBlock FontSize="15" HorizontalAlignment="Right" Text="{Binding StringFormat=Билетов: {0:#}, Path=TicketCount }"/>
									</StackPanel>
								</StackPanel>
							</StackPanel>
						</Grid>
					</Border>
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>

		
	</Grid>
	
</UserControl>
