Class SfRating
Represents a control that has a group of stars or custom shapes to indicate a rating with flexible precision.
Inheritance
Implements
Namespace: Syncfusion.Maui.Inputs
Assembly: Syncfusion.Maui.Inputs.dll
Syntax
public class SfRating : SfDrawableView, IDrawableView, IView, IElement, ITransform, IDrawable, ITouchListener, IKeyboardListener, IParentThemeElement, IThemeElement
Constructors
SfRating()
Initializes a new instance of the SfRating class.
Declaration
public SfRating()
Fields
BackgroundColorProperty
Identifies the BackgroundColor bindable property.This property can be used to customize the background color.
Declaration
public static readonly BindableProperty BackgroundColorProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
IsReadOnlyProperty
Identifies the IsReadOnly bindable property. The Boolean value indicates whether user interaction should be restricted or not.
Declaration
public static readonly BindableProperty IsReadOnlyProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ItemCountProperty
Identifies the ItemCount bindable property. The value indicates whether exact number of rating item to be displayed.
Declaration
public static readonly BindableProperty ItemCountProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ItemSizeProperty
Identifies the ItemSize bindable property. This property can be used to customize the size of item in the SfRating control.
Declaration
public static readonly BindableProperty ItemSizeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ItemSpacingProperty
Identifies the ItemSpacing bindable property. This property can be used to change the spacing between items in SfRating control.
Declaration
public static readonly BindableProperty ItemSpacingProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
PathProperty
Identifies the Path bindable property.This property can be used to give the customize path to draw the rating shape.
Declaration
public static readonly BindableProperty PathProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
PrecisionProperty
Identifies the Precision bindable property. The mode of selection or rating has to be done. By default, the Standard rating is set.
Declaration
public static readonly BindableProperty PrecisionProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RatingSettingsProperty
Identifies RatingSettings bindable property.This property contains all the stroke and color customization of the shape.
Declaration
public static readonly BindableProperty RatingSettingsProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
RatingShapeProperty
Identifies the RatingShape bindable property. The mode of selection or rating has to be done. By default, the Standard rating is set.
Declaration
public static readonly BindableProperty RatingShapeProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
ValueProperty
Identifies the Value bindable property.This property determines the number of items to be selected based on the precision set.
Declaration
public static readonly BindableProperty ValueProperty
Field Value
| Type |
|---|
| Microsoft.Maui.Controls.BindableProperty |
Properties
BackgroundColor
Gets or sets the value of background color.
Declaration
public Color BackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Microsoft.Maui.Graphics.Color | Default color is transparent |
IsReadOnly
Gets or sets the value of IsReadOnly.
Declaration
public bool IsReadOnly { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ItemCount
Gets or sets the number of the item.
Declaration
public int ItemCount { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The Default value is 5. |
ItemSize
Gets or sets the size of the each item.
Declaration
public double ItemSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The Default value is 50. |
ItemSpacing
Gets or sets the space between the each item.
Declaration
public double ItemSpacing { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The Default value is 5. |
Path
Gets or sets the value of Path.
Declaration
public string Path { get; set; }
Property Value
| Type |
|---|
| System.String |
Precision
Gets or sets the precision of the each item.
Declaration
public Precision Precision { get; set; }
Property Value
| Type | Description |
|---|---|
| Precision | The Default value is standard precison . |
RatingSettings
Gets or Sets the value of ratingsettings.
Declaration
public RatingSettings RatingSettings { get; set; }
Property Value
| Type |
|---|
| RatingSettings |
RatingShape
Gets or sets the value of Rating shape.
Declaration
public RatingShape RatingShape { get; set; }
Property Value
| Type |
|---|
| RatingShape |
Value
Gets or sets the value for the control which determines the number of items to be selected based on the precision set.
Declaration
public double Value { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | The Default value is 0. |
Methods
OnBindingContextChanged()
Called when the binding context is changed.
Declaration
protected override void OnBindingContextChanged()
OnDraw(ICanvas, RectF)
Draw method.
Declaration
protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Maui.Graphics.ICanvas | canvas | Canvas. |
| Microsoft.Maui.Graphics.RectF | dirtyRect | Rectangle. |
Overrides
Events
ValueChanged
Occur when user interacts the control to change the value property. Returns the value rated.
Declaration
public event EventHandler<ValueChangedEventArgs> ValueChanged
Event Type
| Type |
|---|
| System.EventHandler<ValueChangedEventArgs> |