ToursPage.axaml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="travel.Views.ToursPage"
  7. xmlns:vm="using:travel.ViewModels"
  8. x:DataType="vm:MainWindowViewModel">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition/>
  12. <RowDefinition Height="3*"/>
  13. </Grid.RowDefinitions>
  14. <StackPanel Orientation="Vertical" VerticalAlignment="Center">
  15. <Grid>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="0.9*"/>
  18. <ColumnDefinition/>
  19. <ColumnDefinition Width="0.2*"/>
  20. </Grid.ColumnDefinitions>
  21. <Grid.RowDefinitions>
  22. <RowDefinition/>
  23. <RowDefinition/>
  24. <RowDefinition/>
  25. <RowDefinition/>
  26. <RowDefinition/>
  27. </Grid.RowDefinitions>
  28. <TextBlock Text="{Binding TP_VM.AllPrice, StringFormat=Общая сумма: {0}}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5"/>
  29. <TextBlock Text="Поиск" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
  30. <TextBox Text="{Binding TP_VM.Search}" MinWidth="250" Height="30" Grid.Column="1" HorizontalAlignment="Left" Margin="5,2" VerticalAlignment="Center"/>
  31. <TextBlock Text="Выберите тип" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
  32. <ComboBox MinWidth="250" ItemsSource="{Binding TP_VM.ListTypes}" SelectedValue="{Binding TP_VM.SelectType}" Height="30" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="5,2" VerticalAlignment="Center"/>
  33. <TextBlock Text="Условие сортировки" Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
  34. <ComboBox MinWidth="250" ItemsSource="{Binding TP_VM.ListSort}" SelectedValue="{Binding TP_VM.SelectSort}" Height="30" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Margin="5,2" VerticalAlignment="Center"/>
  35. <CheckBox Content="Только актуальные" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="{Binding TP_VM.ActualCheck}" Margin="5,0,0,0" FontSize="18"/>
  36. <Button Content="Отели" Grid.Column="2" Margin="10" Command="{Binding GoPageHotel}"/>
  37. </Grid>
  38. </StackPanel>
  39. <ListBox Grid.Row="1" ItemsSource="{Binding TP_VM.ListTours}">
  40. <ListBox.ItemsPanel>
  41. <ItemsPanelTemplate>
  42. <WrapPanel HorizontalAlignment="Center"/>
  43. </ItemsPanelTemplate>
  44. </ListBox.ItemsPanel>
  45. <ListBox.ItemTemplate>
  46. <DataTemplate>
  47. <Border CornerRadius="5" BorderBrush="Black" BorderThickness="2">
  48. <Grid Width="350" Height="300">
  49. <StackPanel Orientation="Vertical">
  50. <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" FontWeight="Bold"/>
  51. <Image HorizontalAlignment="Center" Source="{Binding Image}" Width="250" Margin="0,10"/>
  52. <TextBlock Text="{Binding Price, StringFormat={}{0:C}}" HorizontalAlignment="Center"/>
  53. <Grid ColumnDefinitions="*,*">
  54. <TextBlock Text="{Binding ActualText}" Foreground="{Binding ActualColor}" Margin="10,0"/>
  55. <TextBlock Text="{Binding TicketCount, StringFormat=Билетов: {0}}}" TextAlignment="Right" Margin="10,0" Grid.Column="1"/>
  56. </Grid>
  57. </StackPanel>
  58. </Grid>
  59. </Border>
  60. </DataTemplate>
  61. </ListBox.ItemTemplate>
  62. </ListBox>
  63. </Grid>
  64. </UserControl>