| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?xml version="1.0" encoding="utf-8" ?>
- <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- x:Class="practiceApplicaiton.RoomsPage"
- Title="Комнаты">
- <Grid RowDefinitions="*,Auto" Padding="16" RowSpacing="10">
- <CollectionView Grid.Row="0" x:Name="RoomsList"
- SelectionMode="Single" SelectionChanged="OnSelectionChanged">
- <CollectionView.ItemTemplate>
- <DataTemplate>
- <Frame Margin="0,4" Padding="12" CornerRadius="8"
- BackgroundColor="White" BorderColor="#E0E0E0">
- <Grid ColumnDefinitions="Auto,*,Auto">
- <!-- Номер комнаты -->
- <Frame Grid.Column="0" BackgroundColor="#4472C4"
- CornerRadius="8" Padding="10,6" Margin="0,0,12,0">
- <Label Text="{Binding RoomNumber}"
- TextColor="#E0E0E0" FontAttributes="Bold" FontSize="18"/>
- </Frame>
- <!-- Инфо -->
- <VerticalStackLayout Grid.Column="1" Spacing="3">
- <Label Text="{Binding TypeName}" TextColor="#4472C4"
- FontAttributes="Bold" FontSize="15"/>
- <Label TextColor="#555">
- <Label.FormattedText>
- <FormattedString>
- <Span Text="Вместимость: " TextColor="#4472C4"/>
- <Span Text="{Binding Occupancy} " TextColor="#4472C4"/>
- <Span Text=" чел." TextColor="#4472C4"/>
- </FormattedString>
- </Label.FormattedText>
- </Label>
- </VerticalStackLayout>
- <!-- Рейтинг -->
- <VerticalStackLayout Grid.Column="2" HorizontalOptions="End">
-
- <Label Text="{Binding Rating, StringFormat='{0:F1}'}"
- FontAttributes="Bold" TextColor="#2E4057"
- HorizontalOptions="Center"/>
- </VerticalStackLayout>
- </Grid>
- </Frame>
- </DataTemplate>
- </CollectionView.ItemTemplate>
- </CollectionView>
- <!-- Обновить рейтинг — доступно всем -->
- <Button Grid.Row="1" Text="Обновить рейтинг"
- BackgroundColor="#4472C4" TextColor="White" CornerRadius="8"
- x:Name="EditRatingButton" IsEnabled="False"
- Clicked="OnEditRatingClicked"/>
- </Grid>
- </ContentPage>
|