Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7523313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:45:54+00:00 2026-05-30T02:45:54+00:00

I’ve an error with my pivot application on silverlight for Windows Phone. To reproduce

  • 0

I’ve an error with my pivot application on silverlight for Windows Phone.

To reproduce the problem, create the Pivot Application example. Change xaml to have :

    <Grid x:Name="LayoutRoot" Background="Transparent">
    <!--Pivot Control-->
    <controls:Pivot Title="MY APPLICATION" ItemsSource="{Binding Items}">
        <controls:Pivot.HeaderTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding LineOne}" />
            </DataTemplate>
        </controls:Pivot.HeaderTemplate>
        <controls:Pivot.ItemTemplate>
            <DataTemplate>
                <StackPanel>
                    <TextBlock Text="{Binding LineTwo}" />
                    <advertising:AdControl Grid.Row="2" Grid.ColumnSpan="2" Height="80" Width="480" VerticalAlignment="Top" AdUnitId="10000000" ApplicationId="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa" />
                </StackPanel>
            </DataTemplate>
        </controls:Pivot.ItemTemplate>
    </controls:Pivot>
</Grid>

that is an adcontrol in a pivot itemtemplate.

Don’t forget to add the reference to Microsoft.Advertising.Mobile.UI and to declare namespace :

xmlns:advertising="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"

then, when you run the phone application (on emulator), you have an InvalidCastException.

Without the control, no problem.

How can I solve that ?

Thanks for your help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:45:55+00:00Added an answer on May 30, 2026 at 2:45 am

    If your trying to add views to your pivot you should be using a PivotItem. I’m almost positive the reason for the error is that your putting the AdControl inside of the ItemTemplate of the Pivot Control. There are better ways of doing this.

    Instead just add a bottom margin to the pivot control of 80px. Then add the AdControl inside of the LayoutRoot and set it’s Vertical Alignment to Bottom.

    Not sure I would highly recommend this because of user experience, but if you want an AdControl on each view of the Pivot Control simply add the PivotItems you need and in each place an AdControl.

    Bottom line: Don’t place the AdControl in the ItemTemplate of the PivotControl.

    That should do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.