Dialog Control In Rate My App


This article explains how to control the message box screens of the Rate My App Component. Both screens, namely the review and feedback screens, are very useful and generally used in the same combo. But in some situations we may want to split these two screens. This article explains this.

Rate My App

Rate My App is a ready-made component for adding rating functionality to your app. The Rate My App Component prompts the user by showing a message box. The special thing is, the message comes only after a specific number of uses of the app.

This component also helps you in collecting user feedback by email. If the user wishes not to review your app then one will be directed to a feedback message and the user can send you the feedback.

Some of the properties of the Rate My App that I have used in this demo are as follows.

  • Feedback To

    Email address for sending feedback to. It's a mandatory field.
  • Application Name

    Name of an application. it's a mandatory field.
  • Company name

    Name of the company. It's a mandatory field.
Visibility Change Event

It is mandatory to handle the visibility change event for the rate my app dialog for its proper functioning. But here we are putting our logic inside that event handler. This event is fired every time the dialog visibility is changed. Something else important to remember is that this component opens two separate dialogs (rating and feedback) one after another but for both, the dialog visibility change event is handled by one common event handler. 

Installing Rate My App

Use the following procedure to start using the Rate My App Component:

  1. Open your app project (either an existing one or a new one).

  2. From the toolbar select "Tools" -> "NuGet Package Manager" -> "Package Manager Console".

  3. Now in the Package Manager Console type the following:

    Install-Package ratemyapp

    After typing this you will probably see the log similar to this:

    PM> install-package ratemyapp
    Installing 'RateMyApp 1.1.0'.
    Successfully installed 'RateMyApp 1.1.0'.
    Adding 'RateMyApp 1.1.0' to Demo.
    Successfully added 'RateMyApp 1.1.0' to Demo.

  4. The next step is to add its reference to the XAML page. To do this just add this line:



In this demo I'm using only basic settings and methods of the Rate My App Component. The Boolean variable "feedback" is used for demo purposes only. The "Count" variable is very essential to monitor the various screens. Count=1 indicates a review dialog and count=2 indicates a feedback dialog.

How it works

This trick plays with the visibility change event. Whenever a dialog is displayed, the visibility change event is fired and the first event is triggered by the review dialog and then it is triggered by the feedback dialog. This order of the dialogs is exploited to get our work done.


  1. <phone:PhoneApplicationPage  
  2.     x:Class="Demo.MainPage"  
  3.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
  5.     xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"  
  6.     xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"  
  7.     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
  8.     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
  9.     xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"  
  10.     mc:Ignorable="d"  
  11.     xmlns:c="clr-namespace:RateMyApp.Controls;assembly=RateMyApp"  
  12.     FontFamily="{StaticResource PhoneFontFamilyNormal}"  
  13.     FontSize="{StaticResource PhoneFontSizeNormal}"  
  14.     Foreground="{StaticResource PhoneForegroundBrush}"  
  15.     SupportedOrientations="Portrait" Orientation="Portrait"  
  16.     shell:SystemTray.IsVisible="True">  
  18.     <!--LayoutRoot is the root grid where all page content is placed-->  
  19.     <Grid x:Name="LayoutRoot" Background="Transparent">  
  20.         <Grid.RowDefinitions>  
  21.             <RowDefinition Height="768"/>  
  22.         </Grid.RowDefinitions>  
  24.         <!--TitlePanel contains the name of the application and page title-->  
  25.         <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,512">  
  26.             <TextBlock Text="Demo" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>  
  27.             <TextBlock  Text="Demo" Margin="9,-7,0,0" FontSize="40" />  
  28.         </StackPanel>  
  29.         <StackPanel Orientation="Vertical" Margin="0,461,0,233">  
  30.             <CheckBox IsChecked="True"  Content="Enable Feedback Screen " Unchecked="CheckBox_Unchecked" Checked="CheckBox_Checked"/>  
  31.         </StackPanel>  
  33.         <!--ContentPanel - place additional content here-->  
  34.         <c:FeedbackOverlay x:Name="FeedbackOverlay"   
  35.                              FeedbackTo="test@test.com"   
  36.                              ApplicationName="Demo"   
  37.                              CompanyName="ARDeveloper"    
  38.                            />  
  39.     </Grid>  
  40. </phone:PhoneApplicationPage> 

NOTE: For proper display of the dialog, always follow these two rules:

  1. The "Rate My App" must be the last element in the layout root.
  2. The row span should be large enough to display the message box. In general, row span of 2 works perfectly.

    C# Code Behind

    1. using Microsoft.Phone.Controls;  
    2. using System;  
    3. using System.Collections.Generic;  
    4. using System.Linq;  
    5. using System.Net;  
    6. using System.Windows;  
    7. using System.Windows.Controls;  
    8. using System.Diagnostics;  
    9. using Microsoft.Phone.Tasks;  
    10. using System.Windows.Media;  
    11. using System.Windows.Media.Animation;  
    12. using System.IO;  
    13. using RateMyApp.Helpers;  
    15. namespace Demo  
    16. {  
    17.     public partial class MainPage : PhoneApplicationPage  
    18.     {  
    19.         //For counting msg box  
    20.         public int count = 1;  
    22.         public bool feedBack = true;  
    24.         // Constructor  
    25.         public MainPage()  
    26.         {  
    27.             InitializeComponent();  
    29.             //FeedbackOverlay.Reset();  
    31.             //This line is must for the working of the component.  
    32.             FeedbackOverlay.VisibilityChanged += FeedbackOverlay_VisibilityChanged;              
    33.         }  
    35.         void FeedbackOverlay_VisibilityChanged(object sender, EventArgs e)  
    36.         {  
    37.             if (count==2 && feedBack )  
    38.             {  
    39.                 //Feedback Screen  
    40.                 FeedbackOverlay.Visibility = System.Windows.Visibility.Collapsed;  
    41.                 FeedbackOverlay.Reset();  
    42.                 count = 1;  
    43.             }  
    44.             else  //Count =1  
    45.             {  
    46.                 //Rating screen  
    47.                 count += 1;  
    48.             }  
    49.         }  
    51.         private void CheckBox_Checked(object sender, RoutedEventArgs e)  
    52.         {  
    53.             feedBack = true;  
    54.         }  
    56.         private void CheckBox_Unchecked(object sender, RoutedEventArgs e)  
    57.         {  
    58.             feedBack = false;    
    59.         }  
    60.     }  
    61. }  


    Feedback disabled.