1

In my windows 8 application i have a advertisement in right side of window. When i choose the about page from my charm bar settings pane, the ad sdk control remain in top of the about page.. looks like below...

MainPage.xaml,

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <ads:AdControl Width="160" Height="600" IsEnabled="False" HorizontalAlignment="Right" AdUnitId="10043134" ApplicationId="d25517cb-12d4-4699-8bdc-52040c712cab"></ads:AdControl>
</Grid>

About.xaml(User Control),

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="100"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid Background="#000000">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Button x:Name="butAboutus" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource SnappedBackButtonStyle}" />
        <TextBlock x:Name="pageTitle" Grid.Column="1" Foreground="White" Text="About" Style="{StaticResource PageHeaderTextStyle}" FontSize="30" Margin="0,0,27,39"/>
    </Grid>
    <Grid Grid.Row="1" Background="White">
        <StackPanel Orientation="Vertical" Margin="20,20,0,0">
            <TextBlock Text="Sample about" FontSize="15" Foreground="Black" TextWrapping="Wrap" Margin="0,0,0,15"/>
        </StackPanel>
    </Grid>
</Grid>

what am i doing wrong? how can i solve this problem...?

Thanks in advance.

Maniarasu
  • 362
  • 5
  • 15
  • Thanks for your answers guys... I got best solution from MSDN blog.. Check out [this link.](http://blogs.msdn.com/b/priozersk/archive/2012/08/13/how-to-display-charms-on-a-top-of-the-webview.aspx) Using WebViewBrush and Rectangle they hiding the WebView. It works great for me.. :) – Maniarasu Nov 28 '12 at 09:22

2 Answers2

1

You will have to hide the ad control when you want to display something on top of it. The ad control uses the WebBrowser, which has the (annoying) property of always being on top.

wilbur4321
  • 855
  • 6
  • 10
1

As Wilbur suggested the adcontrol currently uses webview (browser control) and would always appear on top, therefore you'd need to toggle it's visiblity before showing the flyout or popup control. The other nuisance of this control is that it will also take away the focus from the app whenever the ads are refreshed (you might want to set IsEnabled property to false to fix that).

Personally in my view webview and adcontrol are the two controls that needs to be re-written :(

Rohit Sharma
  • 6,136
  • 3
  • 28
  • 47