Hotels.axaml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.Hotels"
  7. xmlns:vm="using:TourAgent.ViewModels"
  8. x:DataType="vm:MainWindowViewModel"
  9. Background="#878787">
  10. <Grid>
  11. <ListBox ItemsSource="{Binding HotelsVM.Hotels}" Grid.Row="1" Background="#878787">
  12. <ListBox.ItemsPanel>
  13. <ItemsPanelTemplate>
  14. <WrapPanel Orientation="Vertical" HorizontalAlignment="Center"/>
  15. </ItemsPanelTemplate>
  16. </ListBox.ItemsPanel>
  17. <ListBox.ItemTemplate>
  18. <DataTemplate>
  19. <Border HorizontalAlignment="Center" BorderBrush="Black" Background="#bae3e8" BorderThickness="1" Padding="15">
  20. <Grid HorizontalAlignment="Center">
  21. <StackPanel Width="800" Orientation="Horizontal" HorizontalAlignment="Center">
  22. <Grid Width="800" ColumnDefinitions="*,*,*,*,1*">
  23. <TextBlock Grid.Column="0" Text="{Binding Name}"/>
  24. <TextBlock Grid.Column="1" Margin="20,0,0,0" Text="{Binding CountOfStars}"/>
  25. <TextBlock Grid.Column="2" Margin="0,0,0,0" Text="{Binding CountryName}"/>
  26. <TextBlock Grid.Column="3" Margin="0,0,0,0" Text="{Binding AmountTours}"/>
  27. <StackPanel Grid.Column="4" HorizontalAlignment="Center">
  28. </StackPanel>
  29. </Grid>
  30. </StackPanel>
  31. </Grid>
  32. </Border>
  33. </DataTemplate>
  34. </ListBox.ItemTemplate>
  35. </ListBox>
  36. <StackPanel Margin="0,0,150,10" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.Row="1">
  37. </StackPanel>
  38. <StackPanel>
  39. <Button HorizontalContentAlignment="Center" VerticalContentAlignment="Top" Command="{Binding ToMenu}" Content="Меню"/>
  40. </StackPanel>
  41. <StackPanel Margin="10,0,650,10" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.Row="1">
  42. <Button IsEnabled="{Binding HotelsVM.EnableOrNotLeft}" Command="{Binding HotelsVM.ToFirstPage}" FontSize="15" Content="В начало"/>
  43. <Button IsEnabled="{Binding HotelsVM.EnableOrNotLeft}" Command="{Binding HotelsVM.PrevPage}" Margin="10,0,0,0" FontSize="15" Content="Назад"/>
  44. </StackPanel>
  45. <StackPanel Margin="10,0,350,10" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="1">
  46. <Button IsEnabled="{Binding HotelsVM.EnableOrNotRight}" Command="{Binding HotelsVM.NextPage}" Margin="0,0,10,0" FontSize="15" Content="Следующая"/>
  47. <Button IsEnabled="{Binding HotelsVM.EnableOrNotRight}" Command="{Binding HotelsVM.ToLastPage}" FontSize="15" Content="В конец"/>
  48. </StackPanel>
  49. <StackPanel Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Right" >
  50. <TextBlock FontSize="25" Text="{Binding HotelsVM.Page}"/>
  51. </StackPanel>
  52. </Grid>
  53. </UserControl>