演示Microsoft Advertising SDK for Windows Phone 8.1

Kenny田發表於2014-03-19

演示Microsoft Advertising SDK for Windows Phone 8.1,Only for Windows Phone 8.1

1、在References上點右鍵,新增引用,找到Microsoft Advertising SDK for Windows Phone 8.1 (XAML)

 

2、能在References裡看到,就是表示新增成功了

 

3、引用程式碼(注意:跟Win8一樣是using開頭的)

xmlns:ui="using:Microsoft.Advertising.Mobile.UI"

 

4、廣告程式碼

<StackPanel>
    <!--640x100_music_video-->
    <TextBlock Text="640x100_music_video" FontSize="20" />
    <ui:AdControl ApplicationId="132e7a5d-97f7-4d24-a5bf-fb88297e2d80" AdUnitId="161706" Width="610" Height="100" HorizontalAlignment="Left" />

    <!--480x80_tools_productivity-->
    <TextBlock Text="480x80_tools_productivity" FontSize="20" />
    <ui:AdControl ApplicationId="132e7a5d-97f7-4d24-a5bf-fb88297e2d80" AdUnitId="161712" Width="480" Height="80" HorizontalAlignment="Left" />

    <!--300x50_sports-->
    <TextBlock Text="300x50_sports" FontSize="20" />
    <ui:AdControl ApplicationId="8311d455-7e75-43e0-a325-7f2ad9279eac" AdUnitId="166517" Width="300" Height="50" HorizontalAlignment="Left" />

    <!--320x50_social-->
    <TextBlock Text="320x50_social" FontSize="20" />
    <ui:AdControl ApplicationId="8311d455-7e75-43e0-a325-7f2ad9279eac" AdUnitId="166614" Width="320" Height="50" HorizontalAlignment="Left" />
</StackPanel>

 

5、F5 跑起來,有圖有真相(沒想到可以同時顯示3個廣告)

 

 

原始碼下載

 

離線 Windows Phone 8.1 SDK 文件

http://download.csdn.net/detail/kennytian/6921913

http://download.csdn.net/detail/kennytian/6921883

http://download.csdn.net/detail/kennytian/6921909

相關文章