Skip to content

Instantly share code, notes, and snippets.

@limitedmage
Created February 23, 2011 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save limitedmage/841388 to your computer and use it in GitHub Desktop.
Save limitedmage/841388 to your computer and use it in GitHub Desktop.
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
{
settings = IsolatedStorageSettings.ApplicationSettings;
Uri savedpage;
if (settings.TryGetValue("page", out savedpage))
{
Browser.Source = savedpage;
}
if (IsTrialMode())
{
ApplicationBarMenuItem b = new ApplicationBarMenuItem("comprar app");
b.Click += BuyButton_Click;
ApplicationBar.MenuItems.Add(b);
}
}
private void BuyButton_Click(object sender, EventArgs e)
{
var detailTask = new Microsoft.Phone.Tasks.MarketplaceDetailTask();
detailTask.Show();
}
private bool IsTrialMode()
{
#if DEBUG
return true;
#else
var licenseInfo = new Microsoft.Phone.Marketplace.LicenseInformation();
return licenseInfo.IsTrial();
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment