This file contains 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
//This function is for changing the license of app from full version to trial while the app is in debug state. | |
//Debug state means that app has not been launched in the marketplace and is still under construction | |
private void Changelicense() | |
{ | |
#if DEBUG | |
//Change the variable accordingly | |
//if you want to implement trial functionality | |
_isTrial = true; | |
//else change it to false if you want to test this app in full version |
This file contains 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
//This function is called whenever we navigate to this page. | |
//In this function we check whether the appliaction is in trial mode or is running in full license. | |
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) | |
{ | |
base.OnNavigatedTo(e); | |
if ((Application.Current as App).IsTrial) | |
{ | |
//show the status |
This file contains 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
//Variable used to indicate whether app is in trial state or not. | |
private static bool _isTrial = true; | |
public bool IsTrial | |
{ | |
get | |
{ | |
return _isTrial; | |
} | |
} |
This file contains 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
public class AppSettings | |
{ | |
private static bool displayAds = true; | |
private static bool isAdBlockerActive = false; | |
public static bool ISADBLOCKERACTIVE | |
{ | |
get | |
{ | |
return isAdBlockerActive; | |
} |
This file contains 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
AppSettings.ISADBLOCKERACTIVE = Windows.ApplicationModel.Store.CurrentApp.LicenseInformation.ProductLicenses["AdBlocker"].IsActive; | |
AppSettings.DISPLAYADS = !AppSettings.ISADBLOCKERACTIVE; |
This file contains 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
<!--LayoutRoot is the root grid where all page content is placed--> | |
<Grid x:Name="LayoutRoot" Background="Transparent"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto"/> | |
<RowDefinition Height="*"/> | |
</Grid.RowDefinitions> | |
<!--TitlePanel contains the name of the application and page title--> | |
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> | |
<TextBlock Text="Trial app" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/> |
This file contains 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
<GoogleAds:AdView Visibility="{Binding DISPLAYADS, Converter={StaticResource BoolToVisibilityConverter}, Source={StaticResource ApplicationSettings}}" AdUnitID="ca-app-pub-0623406534268990/5403604500" HorizontalAlignment="Left" Margin="-10,0,-14,0" Height="80" Width="480" VerticalAlignment="Top"/> |
This file contains 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
if(AppSettings.DISPLAYADS) | |
admob(AdGrid); |
This file contains 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
public class BooleanToVisibilityConverter : IValueConverter | |
{ | |
//Set to true if you want to show control when boolean value is true | |
//Set to false if you want to hide/collapse control when value is true | |
private bool triggerValue = false; | |
public bool TriggerValue | |
{ | |
get { return triggerValue; } | |
set { triggerValue = value; } | |
} |
This file contains 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
public void addhubtile() | |
{ | |
//Creating a new instance of hub tile | |
HubTile hub = new HubTile(); | |
hub.Title = "Hubtile"; | |
hub.Message = "Hello everyone"; | |
hub.Notification = "Notify"; | |
hub.DisplayNotification = true; | |
//adding the hub tile into the grid named contentpannel |