Class SfRating
Represents a control that has a group of stars to indicate a rating with flexible precision.
Inheritance
Namespace: Syncfusion.SfRating.XForms
Assembly: Syncfusion.SfRating.XForms.dll
Syntax
public class SfRating : View, IParentThemeElement, IThemeElement
Constructors
SfRating()
Initializes a new instance of the SfRating class.
Declaration
public SfRating()
Fields
EnableAutoSizeProperty
Identifies the EnableAutoSize bindable property. It indicates whether auto size is enabled or not in SfRating.
Declaration
public static readonly BindableProperty EnableAutoSizeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
EnableCustomViewProperty
Identifies the EnableCustomView bindable property. It indicates whether the custom view is applied or not in SfRating.
Declaration
public static readonly BindableProperty EnableCustomViewProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
EnableViewRangeSelectionProperty
Identifies the EnableViewRangeSelection bindable property. It indicates whether the range selection on custom view can be applied or not in SfRating.
Declaration
public static readonly BindableProperty EnableViewRangeSelectionProperty
Field Value
Type |
---|
Xamarin.Forms.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 |
---|
Xamarin.Forms.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 |
---|
Xamarin.Forms.BindableProperty |
ItemSpacingProperty
Identifies the ItemSpacing bindable property. This property can be used to change the spacing between items in SfRating.
Declaration
public static readonly BindableProperty ItemSpacingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemsProperty
Collection of items that can be populated as Rating Items and get rendered at run-time based on the custom view provided.
Declaration
public static readonly BindableProperty ItemsProperty
Field Value
Type |
---|
Xamarin.Forms.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 |
---|
Xamarin.Forms.BindableProperty |
RatingSettingsProperty
The properties of RatingSettings class that contains all the color customization.
Declaration
public static readonly BindableProperty RatingSettingsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ReadOnlyProperty
Identifies the ReadOnly bindable property. The Boolean value indicates whether user interaction should be restricted or not.
Declaration
public static readonly BindableProperty ReadOnlyProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
TooltipBackgroundColorProperty
The color value that can be applied to the background of tool tip.
Declaration
public static readonly BindableProperty TooltipBackgroundColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
TooltipPlacementProperty
Identifies the TooltipPlacement bindable property. The Enum value indicates the placement of tooltip at either top or bottom.
Declaration
public static readonly BindableProperty TooltipPlacementProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
TooltipPrecisionProperty
Identifies the TooltipPrecision bindable property. The precision value indicates number of digits to be displayed on tooltip.
Declaration
public static readonly BindableProperty TooltipPrecisionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
TooltipTextColorProperty
The color value that can be applied to the text of the tool tip.
Declaration
public static readonly BindableProperty TooltipTextColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ValueProperty
The value for the control which determines the number of items to be selected based on the precision set.
Declaration
public static readonly BindableProperty ValueProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
EnableAutoSize
Gets or sets a value indicating whether gets or sets a Boolean value indicating whether item size can automatically adjusted based on available space.
Declaration
public bool EnableAutoSize { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
EnableCustomView
Gets or sets a value indicating whether gets or sets a Boolean value indicating whether user can apply a custom view.
Declaration
public bool EnableCustomView { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The Default value is false. |
EnableViewRangeSelection
Gets or sets a value indicating whether gets or sets a Boolean value indicating whether user can apply range selection on custom view.
Declaration
public bool EnableViewRangeSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The Default value is false. |
ItemCount
Gets or sets a value indicating whether exact number of rating item to be displayed.
Declaration
public int ItemCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 5. |
Items
Gets or sets a collection of items that can be populated as Rating Items and get rendered at run-time based on the custom view provided.
Declaration
public ObservableCollection<SfRatingItem> Items { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<SfRatingItem> | The default value is null. |
ItemSize
Gets or sets the size of the each item.
Declaration
public int ItemSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The Default value is 50. |
ItemSpacing
Gets or sets the space between each item.
Declaration
public int ItemSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 5. |
Precision
Gets or sets the mode of selection or rating to be done. By default Standard rating will be set.
Declaration
public Precision Precision { get; set; }
Property Value
Type |
---|
Precision |
RatingSettings
Gets or sets the properties of RatingSettings class that contains all the color customization.
Declaration
public SfRatingSettings RatingSettings { get; set; }
Property Value
Type | Description |
---|---|
SfRatingSettings | The sfratingSettings properties. |
ReadOnly
Gets or sets a value indicating whether gets of sets a Boolean value indicating whether user interaction should be restricted or not.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false. |
TooltipBackgroundColor
Gets or sets color value that can be applied to the background of tool tip.
Declaration
public Color TooltipBackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | The default value is white color. |
TooltipPlacement
Gets or sets enum value indicating the placement of tool tip either top or bottom.
Declaration
public TooltipPlacement TooltipPlacement { get; set; }
Property Value
Type | Description |
---|---|
TooltipPlacement | The default value is none. |
TooltipPrecision
Gets or sets the precision value indicating number of digits to be displayed on the tool tip.
Declaration
public int TooltipPrecision { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 1. |
TooltipTextColor
Gets or sets color value that can be applied to the text of the tool tip.
Declaration
public Color TooltipTextColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | The default value is black color. |
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
add_ValueChanged(SfRating.ValueEventHandler)
Declaration
public void add_ValueChanged(SfRating.ValueEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfRating.ValueEventHandler | value |
OnSizeRequest(Double, Double)
Raises the size request event.
Declaration
protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | Width constraint. |
System.Double | heightConstraint | Height constraint. |
Returns
Type | Description |
---|---|
Xamarin.Forms.SizeRequest | size. |
remove_ValueChanged(SfRating.ValueEventHandler)
Declaration
public void remove_ValueChanged(SfRating.ValueEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfRating.ValueEventHandler | value |
Events
ValueChanged
Occur when user interacts the control to change the value property. Returns the value rated.
Declaration
public event SfRating.ValueEventHandler ValueChanged
Event Type
Type |
---|
SfRating.ValueEventHandler |