問題は、IsEnabled
まだコントロールが表示されることです。
次のように、XAML ファイルに広告用の空のコンテナーを追加する必要があります。
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="spAd" Grid.Row="0">
<!--Ad will be placed here via the code-->
</StackPanel>
</Grid>
次に、PhoneApplicationPage_Loaded
イベント ハンドラーで、IsTrial
equalstrue
の場合、 をインスタンスAdControl
化し、ビューに追加します。
AdControl _adControl = new AdControl();
// Use your real Application ID and Ad Unit ID here
_adControl.ApplicationId = "test_client";
_adControl.AdUnitId = "Image480_80";
_adControl.Width = 480;
_adControl.Height = 80;
spAd.Children.Add(_adControl);