Telerik UI for Windows 8 XAML

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

Note

To start using RadRating, first you should add references to the required assemblies:

  • Telerik.Core.dll

  • Telerik.UI.Xaml.Primitives.dll

  • Telerik.UI.Xaml.Input.dll

Then, the following namespace has to be declared:

XAML Copy imageCopy
xmlns:telerikInput="using:Telerik.UI.Xaml.Controls.Input"

Here is how RadRating is declared in XAML:

XAML Copy imageCopy
<telerikInput:RadRating />

In C#:

C# Copy imageCopy
RadRating rating = new RadRating();

The number of rating items can be changed by using one of the following approaches:

  • AutoGeneratedItemsCount property.

  • Manually adding items of type RadRatingItem.

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

XAML Copy imageCopy
<telerikInput:RadRating AutoGeneratedItemsCount="3" />
XAML Copy imageCopy
<telerikInput:RadRating>
    <telerikInput:RadRatingItem/>
    <telerikInput:RadRatingItem/>
    <telerikInput:RadRatingItem/>
</telerikInput:RadRating>
Important

Only one of the methods for defining the number of items should be used. If you try to add items manually when the AutoGeneratedItemsCount is set, or try to set this property when the current items have been added manually, this would cause an exception.