Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Samples

Koen Zwikstra edited this page Feb 7, 2015 · 1 revision

AdControl

Conditional compilation of the Microsoft Advertisement AdControl for Windows 8.1 and Windows Phone 8.1. The AdControl APIs for Windows 8.1 and Windows Phone 8.1 are equal, however the control is defined in different namespaces. XCC to the rescue!

<Page ...
  xmlns:win81="condition:WINDOWS_APP"
  xmlns:wp81="condition:WINDOWS_PHONE_APP"
  mc:Ignorable="d win81 wp81"
  mc:ProcessContent="win81:* wp81:*">
  <win81:Grid>
    <AdControl xmlns="using:Microsoft.Advertising.WinRT.UI"/>
  </win81:Grid>
  <wp81:Grid>
    <AdControl xmlns="using:Microsoft.Advertising.Mobile.UI"/>
  </wp81:Grid>
</Page>

Compile with WINDOWS_APP

<Page ...>
  <Grid>
    <AdControl xmlns="using:Microsoft.Advertising.WinRT.UI"/>
  </Grid>
</Page>

Compile with WINDOWS_PHONE_APP

<Page ...>
  <Grid>
    <AdControl xmlns="using:Microsoft.Advertising.Mobile.UI"/>
  </Grid>
</Page>
Clone this wiki locally