Friday 3 April 2015

Rating control for Windows Phone 8.1 and Windows 8.1

Wonder how to make Rating control in Windows phone 8.1  as there is no toolkit support available for Windows RT apps :(

But No worry We have solutions for this.

Get the Rating control from Nuget.
It's available for Windows RT apps (aka Windows phone 8.1 and Windows 8.1)

Now How to use
  • It works in same way as Windows phone toolkit rating control works.

 <Page  
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
   xmlns:local="using:App3"  
   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
   xmlns:RatingControl="using:JISoft.RatingControl"  
   x:Class="App3.Page1"  
   mc:Ignorable="d">  
   <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">  
     <RatingControl:Rating HorizontalAlignment="Center" VerticalAlignment="Center"   
                AllowSelectingZero="True" ReadOnly="True"  
                RatingItemCount="5" Value="3">  
       <RatingControl:Rating.FilledItemStyle>  
         <Style TargetType="RatingControl:RatingItem">  
           <Setter Property="Background" Value="Goldenrod"/>  
         </Style>  
       </RatingControl:Rating.FilledItemStyle>  
       <RatingControl:Rating.UnfilledItemStyle>  
         <Style TargetType="RatingControl:RatingItem">  
           <Setter Property="Background" Value="Black"/>  
         </Style>  
       </RatingControl:Rating.UnfilledItemStyle>  
     </RatingControl:Rating>  
   </Grid>  
 </Page>  

  • It's complete code for Rating control, once u will put this code in XAML file it will start rendering the rating control
  • Following properties are supported now
    • RatingItemCount - max no of Stars
    • Value - Allocated rating
    • FilledItemStyle - Rating field style
    • UnFilledItemStyle - Rating Empty style
    • AllowSelecteingZero - Can user give zero rating
    • ReadOnly - User allowed to Rate
The Half-Increment of star in not stable so Working on it.. Stay tuned for next update.