private static void ShowRatingPrompt()
{
if (_ratingPrompted)
return;
_ratingPrompted = true;
int launches;
IsolatedStorageSettings.ApplicationSettings.TryGetValue(AppLaunchesKey, out launches);
int nextRatingPrompt;
if (!IsolatedStorageSettings.ApplicationSettings.TryGetValue(NextRatingPromptKey, out nextRatingPrompt))
nextRatingPrompt = DefaultNextRatingPrompt;
if (launches >= nextRatingPrompt)
{
IsolatedStorageSettings.ApplicationSettings[NextRatingPromptKey] = nextRatingPrompt * 2;
NotificationBox.ShowAgain(
"Enjoying?",
"Would you like to review this application?",
"Ask me later",
false,
surpressed => { },
RatingUniqueIdentifier,
new NotificationBoxCommand("Yes", () => new MarketplaceReviewTask().Show()),
new NotificationBoxCommand("No", () => { }));
}
IsolatedStorageSettings.ApplicationSettings[AppLaunchesKey] = ++launches;
IsolatedStorageSettings.ApplicationSettings.Save();
}