Xaml 我的包含微软广告的网格在1秒后消失

Xaml 我的包含微软广告的网格在1秒后消失,xaml,windows-phone-7,Xaml,Windows Phone 7,更新 实际上,在代码中没有任何更改的情况下,它现在运行良好。一个晚上的良好睡眠就是一切!我猜微软昨天的广告服务器一定出了问题。不管怎样,它现在又开始工作了:-) 我的包含广告的网格在1秒后消失。它确实起作用了,但现在我只看到了白色的边框,然后就消失了。这是xaml代码,在代码隐藏中,我将TestMode设置为true。有人知道为什么会这样吗?我是xaml新手,所以我的xaml代码可能有问题 <phone:PhoneApplicationPage xmlns:my="clr-namespac

更新 实际上,在代码中没有任何更改的情况下,它现在运行良好。一个晚上的良好睡眠就是一切!我猜微软昨天的广告服务器一定出了问题。不管怎样,它现在又开始工作了:-)

我的包含广告的网格在1秒后消失。它确实起作用了,但现在我只看到了白色的边框,然后就消失了。这是xaml代码,在代码隐藏中,我将TestMode设置为true。有人知道为什么会这样吗?我是xaml新手,所以我的xaml代码可能有问题

<phone:PhoneApplicationPage xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"  
x:Class="GeoFlick.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded">

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <Grid.RenderTransform>
        <ScaleTransform x:Name="SpinnerScale" ScaleX="1" ScaleY="1" />
    </Grid.RenderTransform>
    <!--TitlePanel contains the name of the application and page title-->
    <Grid Margin="0,0,0,5" Grid.Row="0">

        <TextBlock x:Name="ApplicationTitle" HorizontalAlignment="Left" Text="GeoFlick" Style="{StaticResource PhoneTextNormalStyle}" RenderTransformOrigin="0.5,0.5">
            <TextBlock.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFFF048B" Offset="0"/>
                    <GradientStop Color="#FFA824B1" Offset="1"/>
                </LinearGradientBrush>
            </TextBlock.Foreground>
        </TextBlock>

        <TextBlock x:Name="ImageLoading" Margin="0,0,12,0" TextWrapping="NoWrap" HorizontalAlignment="Right">
            <TextBlock.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF434242" Offset="0"/>
                    <GradientStop Color="#FFA9A7A7" Offset="1"/>
                </LinearGradientBrush>
            </TextBlock.Foreground>
        </TextBlock>

    </Grid>
    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <Image x:Name="FlickrImage"/>
        <Grid x:Name="spinner" Background="Transparent" Visibility="Collapsed">
            <Canvas RenderTransformOrigin="0.5,0.5" Width="120" Height="120" Margin="161,173,175,264">
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="20" Canvas.Top="10" Stretch="Fill" Fill="#FFFF048B" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="2.86816" Canvas.Top="29.9581" Stretch="Fill" Fill="#FF0064CE" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="5.03758e-006" Canvas.Top="57.9341" Stretch="Fill" Fill="#FF1973D4" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="12.1203" Canvas.Top="83.3163" Stretch="Fill" Fill="#FF2E7FD4" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="36.5459" Canvas.Top="98.138" Stretch="Fill" Fill="#FF3F86D0" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="64.6723" Canvas.Top="96.8411" Stretch="Fill" Fill="#674588CE" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="87.6176" Canvas.Top="81.2783" Stretch="Fill" Fill="#675E97D4" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="98.165" Canvas.Top="54.414" Stretch="Fill" Fill="#67719FD2" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="92.9838" Canvas.Top="26.9938" Stretch="Fill" Fill="#6782A9D4" />
                <Ellipse Width="21.835" Height="21.862" Canvas.Left="47.2783" Canvas.Top="0.5" Stretch="Fill" Fill="#FFFF048B" />
                <Canvas.RenderTransform>
                    <RotateTransform x:Name="SpinnerRotate" Angle="3" />
                </Canvas.RenderTransform>
                <Canvas.Triggers>
                    <EventTrigger RoutedEvent="ContentControl.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="SpinnerRotate" Storyboard.TargetProperty="(RotateTransform.Angle)" From="0" To="360" Duration="0:0:01" RepeatBehavior="Forever" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Canvas.Triggers>
            </Canvas>
        </Grid>

    </Grid>

    <Grid x:Name="ImageInfo" Grid.Row="2">
        <TextBlock x:Name="ImageTitle" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,3,0,0" Foreground="#FF9A9898" />            
    </Grid>

    <Grid x:Name="Ads" Grid.Row="3" Visibility="Visible">
        <my:AdControl Height="80" Name="adControl1" Width="480" ApplicationId="test_client" AdUnitId="TextAd" AdModel="Contextual" Foreground="White" />
    </Grid>        

</Grid>


<!--Sample code showing usage of ApplicationBar-->
<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
        <shell:ApplicationBarIconButton IconUri="/icons/appbar.sync.rest.png" Text="Replay" Click="ApplicationBarIconButton_Click_1" />
        <shell:ApplicationBarIconButton IconUri="/icons/appbar.feature.settings.rest.png"  Text="Settings" Click="ApplicationBarIconButton_Click" />
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>


以下是SDK的一些信息,可能会有所帮助:

此外,必须设置 以下属性以启动 收到真实的广告,你不会 从手机广告中接收真实广告 如果未设置以下项,则为服务器 财产

ApplicationId提供了应用程序标识符(ApplicationId) 微软出版中心。参考 正在访问Microsoft pubCenter 以及接收主题广告 有关如何获取 应用程序ID

AdUnitId广告单元标识符(AdUnitId)由Microsoft提供 创建广告单元时发布中心。 请参阅获取访问权限 Microsoft pubCenter和接收广告 主题,以获取有关如何 获得成人资格

测试模式错误


以下是SDK的一些信息,可能会有所帮助:

此外,必须设置 以下属性以启动 收到真实的广告,你不会 从手机广告中接收真实广告 如果未设置以下项,则为服务器 财产

ApplicationId提供了应用程序标识符(ApplicationId) 微软出版中心。参考 正在访问Microsoft pubCenter 以及接收主题广告 有关如何获取 应用程序ID

AdUnitId广告单元标识符(AdUnitId)由Microsoft提供 创建广告单元时发布中心。 请参阅获取访问权限 Microsoft pubCenter和接收广告 主题,以获取有关如何 获得成人资格

测试模式错误


我知道这一点。就像我说的,它成功了,然后就消失了。这是显示测试广告的正确代码。但我猜这是xaml“设计”的问题……我知道这一点。就像我说的,它成功了,然后就消失了。这是显示测试广告的正确代码。但我猜这是xaml“设计”的问题。。。