I want to implement an 'attach location' feature in my application. I've decided to create a user control and put my map in it, then upon a certain button click I show this control in a full screen popup/custom message box.
The problem is that everything works fine except that the map is simply not being displayed; I can retrieve my location, put pushpins, zooming seems working(despite the fact that I'm not seeing anything!).
Whats more weird is that the same code copied and pasted to a phone application page works fine and map appears. I don't understand, is this a limitation that I don't know of?
Here's my code:
<UserControl
.....
xmlns:maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
mc:Ignorable="d"
....
>
<Grid x:Name="LayoutRoot" Background="Black">
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<maps:Map Mode="AerialWithLabels"
Grid.Row="0"
Height="300"
HorizontalAlignment="Left"
Name="map1" VerticalAlignment="Top"
Width="460" Margin="-12,0,0,0">
</maps:Map>
<Button Content="share location"
Name="btn_SendLocation"
IsEnabled="False"
Grid.Row="1"
Click="Button_Click_1"/>
<ListBox Grid.Row="2"
Name="lst_NearBy"
DataContext="{Binding Location}"
Tap="lst_NearBy_Tap">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,5">
<TextBlock Text="{Binding mName}" Style="{StaticResource PhoneTextLargeStyle}"/>
<TextBlock Text="{Binding mVicinity}" Margin="10,0,0,0" Foreground="Gray"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>