Tours.axaml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. FontFamily="{StaticResource Comic}">
  10. <Grid RowDefinitions="*,2.8*">
  11. <StackPanel Margin="0,10,0,0" Orientation="Vertical" HorizontalAlignment="Center" >
  12. <StackPanel Orientation="Horizontal" 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="Horizontal" VerticalAlignment="Center">
  17. <TextBlock Text="Выберите тип: "/>
  18. <ComboBox SelectedIndex="0" ItemsSource="{Binding ToursVM.Types}" Width="300"/>
  19. </StackPanel>
  20. <CheckBox IsChecked="{Binding ToursVM.CheckOrNot}" HorizontalAlignment="Center" Content="Только актуальные туры"/>
  21. </StackPanel>
  22. <ListBox ItemsSource="{Binding ToursVM.Tours}" Grid.Row="1">
  23. <ListBox.ItemsPanel>
  24. <ItemsPanelTemplate>
  25. <WrapPanel Orientation="Horizontal" HorizontalAlignment="Center"/>
  26. </ItemsPanelTemplate>
  27. </ListBox.ItemsPanel>
  28. <ListBox.ItemTemplate>
  29. <DataTemplate>
  30. <Border BorderBrush="Black" BorderThickness="1" Padding="15">
  31. <Grid>
  32. <StackPanel Orientation="Vertical" Width="100" Height="150">
  33. <TextBlock Text="{Binding Name}"/>
  34. <TextBlock Text="{Binding StringFormat={}{0:#} РУБ , Path=Price}"/>
  35. <StackPanel>
  36. <TextBlock Text="{Binding GetActual}"/>
  37. <TextBlock Text="{Binding StringFormat=Билетов: {0:#}, Path=TicketCount }"/>
  38. </StackPanel>
  39. </StackPanel>
  40. </Grid>
  41. </Border>
  42. </DataTemplate>
  43. </ListBox.ItemTemplate>
  44. </ListBox>
  45. </Grid>
  46. </UserControl>