views:

67

answers:

0

I'm working on a WP7 demo app and have gotten my popup working with static resources wich I earlier had problems with. Now when this is out of the way i got a new bug wich regards my use of Bing Maps.

When using bing maps in my default WP7 Silverlight pages (panorama or regual) the maps show up fine, but when using a bing map in my static resource layout the map itself is just showing up black.

Controls around the map such as the navigation pane with zoom and map modes display fine and the bing map logo and distance reference line also show up fine but the map images is just plain black (transparent since the background of my popup is black).

Anyone who encountered this before?

I came up on post where this problem occured in the default silverlight pages (some signed assemblies bug) so I tried their fix with unsigned assemblies but then my WP7 app did not start.

*Edit My popup resource XAML code looks like this.

<ResourceDictionary xmlns:my="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Skanetrafiken.Controls;assembly=Skanetrafiken.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    >
    <Style TargetType="local:MapRouteDialog">
        <Setter Property="Background" Value="{StaticResource PhoneChromeBrush}"/>
        <Setter Property="Width" Value="480"/>
        <Setter Property="Height" Value="800"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:MapRouteDialog">
                    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}" Margin="0, 0, 0, 0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <!--TitlePanel contains the name of the application and page title-->
                        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,30,0,40">
                            <TextBlock x:Name="DialogTitle" Text="MY DIALOG TITLE" Style="{StaticResource PhoneTextNormalStyle}"/>
                        </StackPanel>
                        <my:Map x:Name="RouteMap" Grid.Row="1" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  NavigationVisibility="Visible">
                            <Button x:Name="ButtonZoomIn" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56" Width="56" Margin="8,180,0,0" BorderBrush="{x:Null}" Foreground="{x:Null}">
                                <Button.Background>
                                    <ImageBrush ImageSource="/Skanetrafiken.Controls;component/images/Zoom_In.png" />
                                </Button.Background>
                            </Button>
                            <Button x:Name="ButtonZoomOut" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56" Width="56" Margin="8,260,0,0" BorderBrush="{x:Null}" Foreground="{x:Null}">
                                <Button.Background>
                                    <ImageBrush ImageSource="/Skanetrafiken.Controls;component/images/Zoom_Out.png" />
                                </Button.Background>
                            </Button>
                            <my:MapLayer Name="RouteLines"></my:MapLayer>
                            <my:MapItemsControl Name="PushPins"/>
                        </my:Map>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>

no code needed for displaying a map, this xaml works in a standard silverlight WP7 page but not when used in resources like this. When used like this the map image/content will be missing and transparent.