You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PocketBook/src/BookApp/Composants/RatingView.xaml

28 lines
1.2 KiB

<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:usecase="clr-namespace:BookApp.UseCase"
x:Class="BookApp.Composants.RatingView">
<ContentView.Resources>
<usecase:RatingToStarImageConverter x:Key="RatingToStarConverter"/>
</ContentView.Resources>
<StackLayout Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
<StackLayout x:Name="StarsLayout" BindableLayout.ItemsSource="{Binding Rating}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Image WidthRequest="30" HeightRequest="30">
<Image.Source>
<MultiBinding Converter="{StaticResource RatingToStarConverter}">
<Binding Path="CurrentRating"/>
<Binding Path="."/>
</MultiBinding>
</Image.Source>
</Image>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>
</StackLayout>
</ContentView>