TourPage.axaml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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="1000" d:DesignHeight="450"
  6. xmlns:views="using:AvaloniaApplicationTest.Views"
  7. xmlns:vm="using:AvaloniaApplicationTest.ViewModels"
  8. x:DataType="vm:MainWindowViewModel"
  9. x:Class="AvaloniaApplicationTest.Views.TourPage">
  10. <UserControl.Resources>
  11. <Image x:Key="default" Source="/Assets/img/picture.png"/>
  12. </UserControl.Resources>
  13. <Grid>
  14. <ScrollViewer>
  15. <StackPanel>
  16. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,130,0">
  17. <TextBlock Text="Введите текст для поиска:" Margin="0,6,0,0"/>
  18. <TextBox Text="{Binding PageTours.SearchText}" Width="300" Height="20" Margin="20,0,0,0"/>
  19. <TextBlock Text="{Binding PageTours.AllPrice, StringFormat=Всего: {0:N2} РУБ}" Width="200" FontSize="14" Foreground="#fac716" HorizontalAlignment="Left" Margin="20,0,-50,0"/>
  20. </StackPanel>
  21. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,189,0">
  22. <TextBlock Text="Выберите тип:" Margin="0,6,0,0"/>
  23. <ComboBox ItemsSource="{Binding PageTours.CBTypes}" SelectedValue="{Binding PageTours.ValueSelected}" Width="300" Margin="10,0,0,0" />
  24. <Button Content="Перейти к отелям" Command="{Binding ToHotels}" Margin="30,0,-80,0"/>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,300,0">
  27. <TextBlock Text="Условия сортировки стоимости:" Margin="0,3,0,0"/>
  28. <ComboBox Width="300" Margin="10,0,0,0" ItemsSource="{Binding PageTours.CBTypesSort}" SelectedValue="{Binding PageTours.ValueSelectedSort}"/>
  29. </StackPanel>
  30. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="10,10,300,0">
  31. <TextBlock Text="Только актуальные туры:" Margin="0,3,0,0"/>
  32. <CheckBox IsChecked="{Binding PageTours.SelectedActual}" Margin="10,0,0,0" />
  33. </StackPanel>
  34. <ListBox ItemsSource="{Binding PageTours.LBTours}">
  35. <ListBox.ItemsPanel>
  36. <ItemsPanelTemplate>
  37. <WrapPanel HorizontalAlignment="Center"/>
  38. </ItemsPanelTemplate>
  39. </ListBox.ItemsPanel>
  40. <ListBox.ItemTemplate>
  41. <DataTemplate>
  42. <Border BorderBrush="#fac716" BorderThickness="1" Width="300" Height="300">
  43. <StackPanel>
  44. <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" Margin="0,10,0,0" TextWrapping="Wrap" TextAlignment="Center"/>
  45. <Border BorderBrush="#fac716" BorderThickness="1" Width="250" Height="150" Margin="0,20,0,0">
  46. <Image Source="{Binding ImagePreview, TargetNullValue={StaticResource default}}" HorizontalAlignment="Center" Width="250" Height="150"/>
  47. </Border>
  48. <TextBlock Text="{Binding Price, StringFormat={}{0:N2} РУБ}" HorizontalAlignment="Center" Margin="0,10,0,0"/>
  49. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0">
  50. <TextBlock Text="{Binding Status}" Foreground="{Binding ActualColor}"/>
  51. <TextBlock Text="{Binding TicketCount, StringFormat=Билетов: {0}}" Margin="90,0,0,0"/>
  52. </StackPanel>
  53. </StackPanel>
  54. </Border>
  55. </DataTemplate>
  56. </ListBox.ItemTemplate>
  57. </ListBox>
  58. </StackPanel>
  59. </ScrollViewer>
  60. </Grid>
  61. </UserControl>