Created
February 23, 2011 22:59
-
-
Save limitedmage/841388 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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