- Set Fill Color
- Set Stroke
- Set Stroke Thickness
Contact Support
Appearance Customization in .NET MAUI Rating (SfRating)
You can customize the rated and unrated fill color, stroke and stroke thickness using the following properties of RatingSettings
.
Set Fill Color
SfRating
control has support to set the fill color for the rated and unrated items.
Rated items
The RatedFill
property fills the rated items with the specified solid color in the SfRating
.
<rating:SfRating Value="3">
<rating:SfRating.RatingSettings>
<rating:RatingSettings RatedFill="Red"/>
</rating:SfRating.RatingSettings>
</rating:SfRating>
SfRating rating= new SfRating();
rating.Value = 3;
RatingSettings ratingSettings = new RatingSettings();
ratingSettings.RatedFill = Colors.Red;
rating.RatingSettings = ratingSettings;
Unrated items
The UnratedFill
property fills the unrated items with the specified solid color in the SfRating
.
<rating:SfRating Value="3">
<rating:SfRating.RatingSettings>
<rating:RatingSettings UnratedFill="Gray"/>
</rating:SfRating.RatingSettings>
</rating:SfRating>
SfRating rating= new SfRating();
rating.Value = 3;
RatingSettings ratingSettings = new RatingSettings();
ratingSettings.UnratedFill = Colors.Gray;
rating.RatingSettings = ratingSettings;
Set Stroke
SfRating
control has support to set the stroke color for the rated and unrated items.
Rated items
The RatedStroke
property sets the stroke for the rated items with the specified solid color in the SfRating
control.
<rating:SfRating Value="3">
<rating:SfRating.RatingSettings>
<rating:RatingSettings RatedStroke="Black"/>
</rating:SfRating.RatingSettings>
</rating:SfRating>
SfRating rating= new SfRating();
rating.Value = 3;
RatingSettings ratingSettings = new RatingSettings();
ratingSettings.RatedStroke = Colors.Black;
rating.RatingSettings = ratingSettings;
Unrated items
The UnratedStroke
property sets the stroke for the unrated area with the specified solid color in the SfRating
control.
<rating:SfRating Value="3">
<rating:SfRating.RatingSettings>
<rating:RatingSettings UnratedStroke="Black"/>
</rating:SfRating.RatingSettings>
</rating:SfRating>
SfRating rating= new SfRating();
rating.Value = 3;
RatingSettings ratingSettings = new RatingSettings();
ratingSettings.UnratedStroke = Colors.Black;
rating.RatingSettings = ratingSettings;
Set Stroke Thickness
SfRating
control has support to set the stroke thickness for the rated and unrated items.
Rated items
The RatedStrokeThickness
property sets the stroke thickness for the rated items with the specified value in the SfRating
control.
<rating:SfRating Value="3">
<rating:SfRating.RatingSettings>
<rating:RatingSettings RatedStrokeThickness="3"/>
</rating:SfRating.RatingSettings>
</rating:SfRating>
SfRating rating= new SfRating();
rating.Value = 3;
RatingSettings ratingSettings = new RatingSettings();
ratingSettings.RatedStrokeThickness=3;
rating.RatingSettings = ratingSettings;
Unrated items
The UnratedStrokeThickness
property sets the stroke thickness for the unrated items with the specified value in the SfRating
control.
<rating:SfRating Value="3">
<rating:SfRating.RatingSettings>
<rating:RatingSettings UnratedStrokeThickness="3"/>
</rating:SfRating.RatingSettings>
</rating:SfRating>
SfRating rating= new SfRating();
rating.Value = 3;
RatingSettings ratingSettings = new RatingSettings();
ratingSettings.UnratedStrokeThickness=3;
rating.RatingSettings = ratingSettings;