Hotels.axaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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:DataType="vm:MainWindowViewModel"
  7. xmlns:vm="using:UPtur.ViewModels"
  8. x:Class="UPtur.Views.Hotels">
  9. <Grid RowDefinitions="*,14*">
  10. <Border Background="" BorderThickness="" >
  11. <StackPanel Grid.Row="0" Width="800" HorizontalAlignment="Center" Orientation="Horizontal">
  12. <TextBlock Text="Название отеля"/>
  13. <TextBlock Margin="20,0,0,0" Text="Количество звёзд"/>
  14. <TextBlock Margin="20,0,0,0" Text="Название страны"/>
  15. <TextBlock Margin="20,0,0,0" Text="Количество туров "/>
  16. <TextBlock Margin="20,0,0,0" Text="Количество отелей:"/>
  17. <ComboBox ItemsSource="{Binding HotelsVM.SelectedCountOfElements}" SelectedItem="{Binding HotelsVM.CountElements}" Margin="30,0,0,0" />
  18. </StackPanel>
  19. </Border>
  20. <ListBox SelectionMode="Multiple" SelectedItems="{Binding HotelsVM.SelectedHotels}" ItemsSource="{Binding HotelsVM.Hotels}" Grid.Row="1">
  21. <ListBox.ItemsPanel>
  22. <ItemsPanelTemplate>
  23. <WrapPanel Orientation="Vertical" HorizontalAlignment="Center"/>
  24. </ItemsPanelTemplate>
  25. </ListBox.ItemsPanel>
  26. <ListBox.ItemTemplate>
  27. <DataTemplate>
  28. <Border HorizontalAlignment="Center" BorderBrush="Black" BorderThickness="1" Padding="15">
  29. <Grid HorizontalAlignment="Center">
  30. <StackPanel Width="800" Orientation="Horizontal" HorizontalAlignment="Center">
  31. <Grid Width="800" ColumnDefinitions="*,*,*,*,1*">
  32. <TextBlock Grid.Column="0" Text="{Binding Name}"/>
  33. <TextBlock Grid.Column="1" Margin="20,0,0,0" Text="{Binding CountOfStars}"/>
  34. <TextBlock Grid.Column="2" Margin="0,0,0,0" Text="{Binding CountryName}"/>
  35. <TextBlock Grid.Column="3" Margin="0,0,0,0" Text="{Binding AmountTours}"/>
  36. <StackPanel Grid.Column="4" HorizontalAlignment="Center">
  37. </StackPanel>
  38. </Grid>
  39. </StackPanel>
  40. </Grid>
  41. </Border>
  42. </DataTemplate>
  43. </ListBox.ItemTemplate>
  44. </ListBox>
  45. <StackPanel Margin="10,0,0,10" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom" Grid.Row="1">
  46. <Button Background="#445c93" IsEnabled="{Binding HotelsVM.EnableOrNotLeft}" Command="{Binding HotelsVM.ToFirstPage}" FontSize="15" Content="Начало"/>
  47. <Button Background="#445c93" IsEnabled="{Binding HotelsVM.EnableOrNotLeft}" Command="{Binding HotelsVM.PrevPage}" Margin="10,0,0,0" FontSize="15" Content="Предыдущая"/>
  48. </StackPanel>
  49. <StackPanel Margin="0,0,10,10" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="1">
  50. <Button Background="#445c93" IsEnabled="{Binding HotelsVM.EnableOrNotRight}" Command="{Binding HotelsVM.NextPage}" Margin="0,0,10,0" FontSize="15" Content="Следующая"/>
  51. <Button Background="#445c93" IsEnabled="{Binding HotelsVM.EnableOrNotRight}" Command="{Binding HotelsVM.ToLastPage}" FontSize="15" Content="Конец"/>
  52. </StackPanel>
  53. <StackPanel Margin="0,0,0,10" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.Row="1">
  54. <Button Background="#445c93" Content="Назад" Command="{Binding ToMenu}"/>
  55. </StackPanel>
  56. <StackPanel Margin="10,0,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.Row="1">
  57. </StackPanel>
  58. <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center">
  59. <Button Margin="240,30,0,10" Background="#fac716" Width="130" HorizontalContentAlignment="Center" Content="Удалить"/>
  60. </StackPanel>
  61. </Grid>
  62. </UserControl>