HotelCard.axaml 3.6 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="travel.HotelCard"
  7. xmlns:vm="using:travel.ViewModels"
  8. x:DataType="vm:MainWindowViewModel">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition/>
  12. <RowDefinition Height="0.5*"/>
  13. <RowDefinition Height="0.5*"/>
  14. <RowDefinition Height="0.5*"/>
  15. <RowDefinition Height="0.5*"/>
  16. <RowDefinition/>
  17. <RowDefinition/>
  18. </Grid.RowDefinitions>
  19. <Grid.ColumnDefinitions>
  20. <ColumnDefinition Width="0.6*"/>
  21. <ColumnDefinition/>
  22. </Grid.ColumnDefinitions>
  23. <StackPanel Orientation="Vertical" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" >
  24. <TextBlock Text="Карточка отеля" FontSize="25" HorizontalAlignment="Center"/>
  25. <Border BorderBrush="Black" BorderThickness="2" Height="2" Width="550"/>
  26. </StackPanel>
  27. <TextBlock Text="Название отеля:" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
  28. <TextBlock Text="Количество звезд:" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
  29. <TextBlock Text="Описание (не обяз):" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
  30. <TextBlock Text="Страна:" Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
  31. <TextBox Text="{Binding hc_VM.TitleHotel}" Width="350" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="Wrap"/>
  32. <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center">
  33. <Button Content="{Binding hc_VM.Star1}" Command="{Binding hc_VM.SelectStar1}" Background="Transparent" FontSize="30" Foreground="#fac716"/>
  34. <Button Content="{Binding hc_VM.Star2}" Command="{Binding hc_VM.SelectStar2}" Background="Transparent" FontSize="30" Foreground="#fac716"/>
  35. <Button Content="{Binding hc_VM.Star3}" Command="{Binding hc_VM.SelectStar3}" Background="Transparent" FontSize="30" Foreground="#fac716"/>
  36. <Button Content="{Binding hc_VM.Star4}" Command="{Binding hc_VM.SelectStar4}" Background="Transparent" FontSize="30" Foreground="#fac716"/>
  37. <Button Content="{Binding hc_VM.Star5}" Command="{Binding hc_VM.SelectStar5}" Background="Transparent" FontSize="30" Foreground="#fac716"/>
  38. </StackPanel>
  39. <TextBox Text="{Binding hc_VM.DescriptionHotel}" Width="350" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="Wrap"/>
  40. <ComboBox ItemsSource="{Binding hc_VM.ListCountry}" SelectedItem="{Binding hc_VM.SelectCountry}" MinWidth="350" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center"/>
  41. <Image Source="/Assets/logo_travel.png" Grid.RowSpan="7" Width="150" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
  42. <TextBlock Text="{Binding hc_VM.Message}" Grid.Row="6" Grid.ColumnSpan="2" HorizontalAlignment="Center"/>
  43. <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.ColumnSpan="2" HorizontalAlignment="Center">
  44. <Button Content="Сохранить" Margin="10" Command="{Binding hc_VM.SaveCard}" Background="#bae3e8"/>
  45. <Button Content="Назад" Margin="10" Command="{Binding GoPageHotel}" Background="#e31e24"/>
  46. </StackPanel>
  47. </Grid>
  48. </UserControl>