New to Telerik UI for WPFStart a free 30-day trial

Rating control is a flexible UI component that allows users to intuitively rate by selecting number of items [stars].

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Input.dll

Syntax:

C#
[TelerikToolboxCategory("Input")]
[Themable]
public class RadRating : ItemsControl, IUpdateVisualState

Inheritance: objectRadRating

Implements: IUpdateVisualState

Constructors

Initializes a new instance of the RadRating class.

C#
public RadRating()

Fields

IsReadOnlyProperty

DependencyProperty

Identifies the IsReadOnly dependency property.

C#
public static readonly DependencyProperty IsReadOnlyProperty

Identifies the NumberOfItemsToGenerateProperty dependency property.

C#
public static readonly DependencyProperty NumberOfItemsToGenerateProperty

PrecisionProperty

DependencyProperty

Identifies the Precision dependency property.

C#
public static readonly DependencyProperty PrecisionProperty

ValueProperty

DependencyProperty

Identifies the Value dependency property.

C#
public static readonly DependencyProperty ValueProperty

Properties

Gets or sets a value indicating whether this instance is read only.

C#
public bool IsReadOnly { get; set; }

Gets or sets the number of items to generate.

C#
public int NumberOfItemsToGenerate { get; set; }
Property Value:

The number of items to generate.

Gets or sets the rating precision.

C#
public RatingPrecision Precision { get; set; }
Property Value:

The precision.

Gets or sets the value.

C#
public double? Value { get; set; }
Property Value:

The value.

Methods

Undoes the effects of the method.

C#
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters:elementDependencyObject

The container element.

itemobject

The item.

Creates or identifies the element that is used to display the given item.

C#
protected override DependencyObject GetContainerForItemOverride()
Returns:

DependencyObject

The element that is used to display the given item.

Determines if the specified item is (or is eligible to be) its own container.

C#
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters:itemobjectReturns:

bool

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .

C#
public override void OnApplyTemplate()

Creates new ratingAutomationPeer when needed.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Called when the value of the property changes.

C#
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters:eNotifyCollectionChangedEventArgs

A NotifyCollectionChangedEventArgs that contains the event data.

Called when [rating item value selected].

C#
protected void OnRatingItemValueSelected(RadRatingItem ratingItem, double newValue)
Parameters:ratingItemRadRatingItem

The rating item.

newValuedouble

The new value.

Prepares the specified element to display the specified item.

C#
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters:elementDependencyObject

Element used to display the specified item.

itemobject

Specified item.

Resets the theme.

C#
public void ResetTheme()

Events

ValueChanged

RoutedPropertyChangedEventHandler<double?>

Occurs when value changed.

C#
public event RoutedPropertyChangedEventHandler<double?> ValueChanged