Tours.axaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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="UPtur.Views.Tours"
  7. xmlns:vm="using:UPtur.ViewModels"
  8. x:DataType="vm:MainWindowViewModel"
  9. FontFamily="Comic Sans MS">
  10. <Grid Background="#bae3e8" RowDefinitions="*,2.0*">
  11. <StackPanel Margin="0,10,0,10" Orientation="Vertical" HorizontalAlignment="Center" >
  12. <StackPanel Orientation="Vertical" VerticalAlignment="Center">
  13. <TextBlock Text="Введите текст для поиска: "/>
  14. <TextBox Text="{Binding ToursVM.FindTour}" Width="300" Watermark="Поиск по названию"></TextBox>
  15. </StackPanel>
  16. <StackPanel Margin="0,10,0,0" Orientation="Vertical" VerticalAlignment="Center">
  17. <TextBlock Margin="0,0,0,0" Text="Выберите тип: "/>
  18. <ComboBox SelectedIndex="0" SelectedItem="{Binding ToursVM.SelectedItem}" ItemsSource="{Binding ToursVM.Types}" Width="300"/>
  19. </StackPanel>
  20. <StackPanel HorizontalAlignment="Center" Margin="0,10,0,0" Orientation="Vertical" VerticalAlignment="Center">
  21. <TextBlock VerticalAlignment="Center" Text="Выберите сортировку: "/>
  22. <ComboBox SelectedIndex="0" SelectedItem="{Binding ToursVM.SelectedSort}" ItemsSource="{Binding ToursVM.Sort}" Width="300"/>
  23. </StackPanel>
  24. <CheckBox IsChecked="{Binding ToursVM.CheckOrNot}" HorizontalAlignment="Left" Content="Только актуальные туры"/>
  25. </StackPanel>
  26. <ListBox Background="#bae3e8" ItemsSource="{Binding ToursVM.Tours}" Grid.Row="1">
  27. <ListBox.ItemsPanel>
  28. <ItemsPanelTemplate>
  29. <WrapPanel Orientation="Horizontal" HorizontalAlignment="Center"/>
  30. </ItemsPanelTemplate>
  31. </ListBox.ItemsPanel>
  32. <ListBox.ItemTemplate>
  33. <DataTemplate>
  34. <Border Width="300" Height="270" BorderBrush="Black" BorderThickness="1" Padding="5">
  35. <StackPanel Orientation="Vertical" VerticalAlignment="Center">
  36. <TextBlock Margin="0 0 0 5" TextWrapping="Wrap" FontSize="19" TextAlignment="Center" HorizontalAlignment="Center" Text="{Binding Name}"></TextBlock>
  37. <Image HorizontalAlignment="Center" Width="270" Height="150" Source="{Binding GetPic}"/>
  38. <TextBlock Margin="5" FontSize="20" FontWeight="ExtraBold" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding StringFormat={}{0:#} РУБ, Path=Price}"></TextBlock>
  39. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  40. <StackPanel HorizontalAlignment="Left" Margin="0 0 25 0">
  41. </StackPanel>
  42. <StackPanel HorizontalAlignment="Right" Margin="25 0 0 0">
  43. <TextBlock FontSize="16" Text="{Binding StringFormat=Билетов: {0:#}, Path=TicketCount}"></TextBlock>
  44. </StackPanel>
  45. <TextBlock HorizontalAlignment="Left" FontSize="15" Foreground="{Binding Color}" Text="{Binding Actual}"/>
  46. </StackPanel>
  47. </StackPanel>
  48. </Border>
  49. </DataTemplate>
  50. </ListBox.ItemTemplate>
  51. </ListBox>
  52. <StackPanel VerticalAlignment="Top" Margin="10,26,10,10">
  53. <Button Background="#445c93" Width="120" Height="35" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Command="{Binding Navigate}" Content="Назад"/>
  54. </StackPanel>
  55. </Grid>
  56. </UserControl>