Hotels.axaml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <Button Width="130" HorizontalContentAlignment="Left" Content="Редактировать"/>
  29. <Button Width="130" HorizontalContentAlignment="Left" Content="Удалить"/>
  30. </StackPanel>
  31. </Grid>
  32. </StackPanel>
  33. </Grid>
  34. </Border>
  35. </DataTemplate>
  36. </ListBox.ItemTemplate>
  37. </ListBox>
  38. <StackPanel Margin="10,0,0,10" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom" Grid.Row="1">
  39. <Button IsEnabled="{Binding HotelsVM.EnableOrNotLeft}" Command="{Binding HotelsVM.ToFirstPage}" FontSize="15" Content="В начало"/>
  40. <Button IsEnabled="{Binding HotelsVM.EnableOrNotLeft}" Command="{Binding HotelsVM.PrevPage}" Margin="10,0,0,0" FontSize="15" Content="Лево"/>
  41. </StackPanel>
  42. <StackPanel Margin="0,0,10,10" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="1">
  43. <Button IsEnabled="{Binding HotelsVM.EnableOrNotRight}" Command="{Binding HotelsVM.NextPage}" Margin="0,0,10,0" FontSize="15" Content="Право"/>
  44. <Button IsEnabled="{Binding HotelsVM.EnableOrNotRight}" Command="{Binding HotelsVM.ToLastPage}" FontSize="15" Content="В конец"/>
  45. </StackPanel>
  46. <StackPanel Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Left" >
  47. <TextBlock FontSize="25" Text="{Binding HotelsVM.Page}"/>
  48. </StackPanel>
  49. </Grid>
  50. </UserControl>