RoomsPage.xaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.RoomsPage"
  5. Title="Комнаты">
  6. <Grid RowDefinitions="*,Auto" Padding="16" RowSpacing="10">
  7. <CollectionView Grid.Row="0" x:Name="RoomsList"
  8. SelectionMode="Single" SelectionChanged="OnSelectionChanged">
  9. <CollectionView.ItemTemplate>
  10. <DataTemplate>
  11. <Frame Margin="0,4" Padding="12" CornerRadius="8"
  12. BackgroundColor="White" BorderColor="#E0E0E0">
  13. <Grid ColumnDefinitions="Auto,*,Auto">
  14. <!-- Номер комнаты -->
  15. <Frame Grid.Column="0" BackgroundColor="#4472C4"
  16. CornerRadius="8" Padding="10,6" Margin="0,0,12,0">
  17. <Label Text="{Binding RoomNumber}"
  18. TextColor="#E0E0E0" FontAttributes="Bold" FontSize="18"/>
  19. </Frame>
  20. <!-- Инфо -->
  21. <VerticalStackLayout Grid.Column="1" Spacing="3">
  22. <Label Text="{Binding TypeName}" TextColor="#4472C4"
  23. FontAttributes="Bold" FontSize="15"/>
  24. <Label TextColor="#555">
  25. <Label.FormattedText>
  26. <FormattedString>
  27. <Span Text="Вместимость: " TextColor="#4472C4"/>
  28. <Span Text="{Binding Occupancy} " TextColor="#4472C4"/>
  29. <Span Text=" чел." TextColor="#4472C4"/>
  30. </FormattedString>
  31. </Label.FormattedText>
  32. </Label>
  33. </VerticalStackLayout>
  34. <!-- Рейтинг -->
  35. <VerticalStackLayout Grid.Column="2" HorizontalOptions="End">
  36. <Label Text="{Binding Rating, StringFormat='{0:F1}'}"
  37. FontAttributes="Bold" TextColor="#2E4057"
  38. HorizontalOptions="Center"/>
  39. </VerticalStackLayout>
  40. </Grid>
  41. </Frame>
  42. </DataTemplate>
  43. </CollectionView.ItemTemplate>
  44. </CollectionView>
  45. <!-- Обновить рейтинг — доступно всем -->
  46. <Button Grid.Row="1" Text="Обновить рейтинг"
  47. BackgroundColor="#4472C4" TextColor="White" CornerRadius="8"
  48. x:Name="EditRatingButton" IsEnabled="False"
  49. Clicked="OnEditRatingClicked"/>
  50. </Grid>
  51. </ContentPage>