Y
Y
Yurii Medvedev2012-10-26 10:30:17
Microsoft Silverlight
Yurii Medvedev, 2012-10-26 10:30:17

The map control is rendering incorrectly

Lord, I ask for your help, I don’t know what to do anymore.
There was a need to display the map control directly in the elements of the ListBox lists. Everything works cool, right, except for one huge jamb: when scrolling through a list that has elements with a map, the control for some reason is displayed on top of the parent container, i.e. not only the ListBox itself, but even the LayoutRoot

image image

<phone:PhoneApplicationPage
    xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"  
    x:Class="BingMap.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="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
    
    <Grid x:Name="LayoutRoot" Background="Transparent" Loaded="LayoutRoot_Loaded">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox x:Name="listbox">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <my:Map  Margin="10" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>
 
</phone:PhoneApplicationPage>


added three elements for the test:
private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
{
            listbox.Items.Add("");
            listbox.Items.Add("");
            listbox.Items.Add("");
}


Can you suggest how to get rid of this jamb? I couldn't find on google if anyone had this problem.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yurii Medvedev, 2012-10-27
@kin9pin

I asked myself, I will answer.
Instead of using the slow Bing control in lists, you should use the Image control and give it a static map image, which can be obtained by reading this documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question