Telerik UI for Windows Phone

Before using the RadTrialReminders references to the following assemblies have to be added:

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

The TrialReminders use the static class ApplicationUsageHelper to get information about the application installation. So, in order to use the reminder, first you have to call the Init method of the ApplicationUsageHelper with the version of you application. This should be done in Application_Launching inside the App.xaml.cs file. The method OnApplicationActivated should be called in Application_Activated to ensure that the ApplicationUsageHelper will be initialized even after the application has been tombstoned. Here is an example:

CopyC#
private void Application_Launching(object sender, LaunchingEventArgs e)
{
    ApplicationUsageHelper.Init("2.2");
}

private void Application_Activated(object sender, ActivatedEventArgs e)
{
    ApplicationUsageHelper.OnApplicationActivated();
}

After this a new instance of RadTrialFeatureReminder and/or RadTrialApplicationReminder can be declared as any normal Silverlight control:

CopyC#
RadTrialApplicationReminder radTrialApplicationReminder = new RadTrialApplicationReminder();

RadTrialFeatureReminder radTrialFeatureReminder = new RadTrialFeatureReminder();

Here are the three periods in a trial application:

  • FreeUsage - this is the period when the user uses the application without being notified that this is a trial
  • TrialPeriod with reminders - after the FreeUsage period is expired, the trial continues, but the reminder is displayed to notify the user about the trial
  • TrialPeriod expired - after the Trial period is expired - the IsTrialExpired property is now True. This value can be checked to ensure that the feature and/or application will be available only if IsTrialExpired is false.

Here is an example for using the IsTrialExpired property:

CopyC#
if (!reminder.IsTrialExpired)
{
   // perform the standart feature/application actions
}
Note
Note that the reminder will take no special action when the trial is expired, except setting the IsTrialExpired property to True. You are free to implement your own logic about what should happen when the trial is over. For example, you can navigate to a special page; throw an exception; disable a feature button or whatever you decide that should happen when the trial is over.

The trials have two types:

  • usage-based - trials, that expire after a specific amount of application/feature usages.
  • time-based - trials, that expire after a specific time has passed after the installation of the application.

Usage-based

The properties that are relevant here are: FreeUsageCount, OccurrenceUsageCount and AllowedTrialUsageCount. The FreeUsageCount specifies the usages in FreeUsage state. AllowedTrialUsageCount specifies the number of usages that are included in the trial. OccurrenceUsageCount specifies how often the user will be reminded that it is a trial version.

Time-based

The properties for this scenario are similar and are respectively: FreePeriod, OccurrencePeriod and AllowedTrialPeriod. They have the same idea like the properties for the usage-based trials with the difference that the reminder will not be dependent on usages but on time that has passed from the installation of the application.