BookingsPage.xaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. x:Class="practiceApplicaiton.BookingsPage"
  5. Title="Бронирования">
  6. <Grid RowDefinitions="Auto,*,Auto" Padding="16" RowSpacing="10">
  7. <!-- Поиск -->
  8. <Grid Grid.Row="0" ColumnDefinitions="*,Auto" ColumnSpacing="8">
  9. <Entry x:Name="SearchEntry" Placeholder="Поиск по фамилии или номеру комнаты"
  10. TextChanged="OnSearchChanged"/>
  11. <Button Grid.Column="1" Text="+ Добавить"
  12. BackgroundColor="#4472C4" TextColor="White"
  13. CornerRadius="8" Clicked="OnAddClicked"
  14. IsVisible="{Binding CanEdit}"/>
  15. </Grid>
  16. <!-- Список -->
  17. <CollectionView Grid.Row="1" x:Name="BookingsList"
  18. SelectionMode="Single"
  19. SelectionChanged="OnSelectionChanged">
  20. <CollectionView.ItemTemplate>
  21. <DataTemplate>
  22. <Frame Margin="0,4" Padding="12" CornerRadius="8"
  23. BackgroundColor="White" BorderColor="#E0E0E0">
  24. <Grid ColumnDefinitions="*,Auto">
  25. <VerticalStackLayout Spacing="4">
  26. <Label Text="{Binding ClientFullName}" TextColor="#4472C4"
  27. FontAttributes="Bold" FontSize="15"/>
  28. <Label TextColor="#555">
  29. <Label.FormattedText>
  30. <FormattedString>
  31. <Span Text="Комната: "/>
  32. <Span Text="{Binding RoomNumber}" FontAttributes="Bold"/>
  33. <Span Text=" ("/>
  34. <Span Text="{Binding RoomType}"/>
  35. <Span Text=")"/>
  36. </FormattedString>
  37. </Label.FormattedText>
  38. </Label>
  39. <Label TextColor="#555">
  40. <Label.FormattedText>
  41. <FormattedString>
  42. <Span Text="{Binding CheckInDate, StringFormat='{0:dd.MM.yyyy}'}"/>
  43. <Span Text=" — "/>
  44. <Span Text="{Binding CheckOutDate, StringFormat='{0:dd.MM.yyyy}'}"/>
  45. <Span Text=" "/>
  46. <Span Text="{Binding Nights}"/>
  47. <Span Text=" ночей"/>
  48. </FormattedString>
  49. </Label.FormattedText>
  50. </Label>
  51. </VerticalStackLayout>
  52. <Label Grid.Column="1"
  53. Text="{Binding TotalCost, StringFormat='{0:N0} ₽'}"
  54. FontAttributes="Bold" FontSize="16"
  55. TextColor="#2E4057" VerticalOptions="Center"/>
  56. </Grid>
  57. </Frame>
  58. </DataTemplate>
  59. </CollectionView.ItemTemplate>
  60. </CollectionView>
  61. <!-- Кнопки действий -->
  62. <Grid Grid.Row="2" ColumnDefinitions="*,*" ColumnSpacing="8"
  63. IsVisible="{Binding CanEdit}">
  64. <Button Text="Редактировать" BackgroundColor="#4472C4"
  65. TextColor="White" CornerRadius="8"
  66. x:Name="EditButton" IsEnabled="False"
  67. Clicked="OnEditClicked"/>
  68. <Button Grid.Column="1" Text="Удалить"
  69. BackgroundColor="#C0392B" TextColor="White"
  70. CornerRadius="8" x:Name="DeleteButton" IsEnabled="False"
  71. Clicked="OnDeleteClicked"/>
  72. </Grid>
  73. </Grid>
  74. </ContentPage>