Telerik UI for Windows Phone by Progress

This topic demonstrates how to start using RadRating for Windows Phone.

To start using RadRating, the first thing that has to be done is adding references to the required assemblies:

  • Telerik.Windows.Core.dll
  • Telerik.Windows.Controls.Primitives.dll
  • Telerik.Windows.Controls.Input.dll

Then, the following namespace has to be declared:

CopyXAML
xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"

Here is how RadRating is declared in XAML:

CopyXAML
<telerikInput:RadRating x:Name="radRating" />

And in C#:

CopyC#
RadRating rating = new RadRating();

The number of rating items can be changed by using one of these two methods:

  • by using the AutoGeneratedItemsCount property
  • by manually adding items of type RadRatingItem

Here are the examples for creating a rating with 3 items using each of the methods:

CopyXAML
<telerikInput:RadRating AutoGeneratedItemsCount="3" />

<telerikInput:RadRating>
    <telerikInput:RadRatingItem/>
    <telerikInput:RadRatingItem/>
    <telerikInput:RadRatingItem/>
</telerikInput:RadRating>
Note

Note that, only one of the methods for defining the number of items should be used. The following actions would cause an exception:

  • Add items manually, when the AutoGeneratedItemsCount property is set.
  • Set AutoGeneratedItemsCount property when the current items have been added manually.