0

アプリの試用期間中は広告を表示し、アプリが完全にライセンスを取得すると表示されないようにしたいと考えています。

クーキス~

Private Sub PhoneApplicationPage_Loaded(sender As System.Object, e As System.Windows.RoutedEventArgs)

    If App.IsTrial Then
        AdControl1.Visibility = Windows.Visibility.Visible

    Else
        AdControl1.Visibility = Windows.Visibility.Collapsed
    End If

End Sub
4

1 に答える 1

1

問題は、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イベント ハンドラーで、IsTrialequalstrueの場合、 をインスタンス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);
于 2012-11-05T15:25:34.367 に答える