Tours.axaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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="TourAgent.Views.Tours"
  7. xmlns:vm="using:TourAgent.ViewModels"
  8. x:DataType="vm:MainWindowViewModel"
  9. Background="#878787"
  10. FontFamily="{StaticResource Comic}">
  11. <Grid RowDefinitions="*,2.9*" >
  12. <StackPanel Margin="0,10,0,15" Orientation="Vertical" HorizontalAlignment="Stretch" >
  13. <Button HorizontalContentAlignment="Right" VerticalContentAlignment="Top" Command="{Binding ToMenu}" Content="Меню"/>
  14. <TextBlock Margin="0,0,10,0" HorizontalAlignment="Right" Text="{Binding StringFormat=Общая стоимость туров {0:C}, Path=ToursVM.PriceOfAll}"/>
  15. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
  16. <TextBlock VerticalAlignment="Center" Text="Поиск: " />
  17. <TextBox Text="{Binding ToursVM.FindTour}" Width="300" Watermark="Поиск по названию и описанию"></TextBox>
  18. </StackPanel>
  19. <StackPanel HorizontalAlignment="Right" Margin="0,10,0,0" Orientation="Horizontal" VerticalAlignment="Center">
  20. <TextBlock VerticalAlignment="Center" Text="Тип: "/>
  21. <ComboBox SelectedIndex="0" SelectedItem="{Binding ToursVM.SelectedItem}" ItemsSource="{Binding ToursVM.Types}" Width="300"/>
  22. </StackPanel>
  23. <StackPanel HorizontalAlignment="Right" Margin="0,10,0,0" Orientation="Horizontal" VerticalAlignment="Center">
  24. <TextBlock VerticalAlignment="Center" />
  25. <ComboBox SelectedIndex="0" SelectedItem="{Binding ToursVM.SelectedSort}" ItemsSource="{Binding ToursVM.Sort}" Width="300"/>
  26. </StackPanel>
  27. <CheckBox IsChecked="{Binding ToursVM.CheckOrNot}" HorizontalAlignment="Right" Content="Актуальные туры"/>
  28. </StackPanel>
  29. <ListBox ItemsSource="{Binding ToursVM.Tours}" Grid.Row="1" Background="#878787">
  30. <ListBox.ItemsPanel>
  31. <ItemsPanelTemplate>
  32. <WrapPanel Orientation="Horizontal" HorizontalAlignment="Center"/>
  33. </ItemsPanelTemplate>
  34. </ListBox.ItemsPanel>
  35. <ListBox.ItemTemplate>
  36. <DataTemplate>
  37. <Border HorizontalAlignment="Stretch" BorderBrush="Black" Background="#bae3e8" BorderThickness="1" Padding="15">
  38. <Grid HorizontalAlignment="Stretch">
  39. <StackPanel HorizontalAlignment="Stretch" Orientation="Vertical" Width="300" Height="250">
  40. <TextBlock FontSize="18" HorizontalAlignment="Center" Text="{Binding Name}"/>
  41. <TextBlock FontWeight="Bold" FontSize="18" HorizontalAlignment="Center" Text="{Binding StringFormat={}{0:#} РУБ , Path=Price}"/>
  42. <StackPanel Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
  43. <StackPanel HorizontalAlignment="Left">
  44. <TextBlock HorizontalAlignment="Left" FontSize="15" Foreground="{Binding GetColor}" Text="{Binding GetActual}"/>
  45. </StackPanel>
  46. <StackPanel Margin="120,0,0,0" HorizontalAlignment="Right" >
  47. <TextBlock FontSize="15" HorizontalAlignment="Right" Text="{Binding StringFormat=Билетов: {0:#}, Path=TicketCount }"/>
  48. </StackPanel>
  49. </StackPanel>
  50. </StackPanel>
  51. </Grid>
  52. </Border>
  53. </DataTemplate>
  54. </ListBox.ItemTemplate>
  55. </ListBox>
  56. </Grid>
  57. </UserControl>