Note that there are some explanatory texts on larger screens.

plurals
  1. POTwoway binding causes strange behaviour in maps control for wp7
    primarykey
    data
    text
    <p>I'm developing an application for windows phone using the maps control. The map control binds its center and its zoomlevel property to two properties on a viewmodel.</p> <p>The map control is on a page seperate from the mainpage of the application. Every time a user moves to the map the page binds to a viewmodel. This viewmodel is a singleton (always the same instance).</p> <p>the first time I move to the map navigating on the map works fine, but when I go back and navigate to the map again, navigation has some sort of bounce like it is push backed to its initial location. To see this behaviour do the following:</p> <ul> <li>Navigate to the mapPage bij clicking on the button on the mainpage. At this time the map control works as expected.</li> <li>Click the back button to return to the mainpage.</li> <li>Click the button on the mainpage again to navigate to the mappage for the second time. Now when sliding the map the control behaves strange by bouncing back to the original location before sliding.</li> </ul> <p>The mainpage contains just a button to navigate to the map page which looks as follows:</p> <pre><code>&lt;phone:PhoneApplicationPage x:Class="MapTester.Map" 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" xmlns:maps="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480" shell:SystemTray.IsVisible="True" DataContext="{Binding Path=MapViewModel, Source={StaticResource ViewModelLocator}}"&gt; &lt;!--LayoutRoot is the root grid where all page content is placed--&gt; &lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;maps:Map Center="{Binding Center, Mode=TwoWay}" ZoomLevel="{Binding ZoomLevel,Mode=TwoWay}" ZoomBarVisibility="Visible" CredentialsProvider="" ScaleVisibility="Visible"&gt;&lt;/maps:Map&gt; &lt;/Grid&gt; &lt;/phone:PhoneApplicationPage&gt; </code></pre> <p>The MapViewModel is defined on the ViewModelLocator. I created a solution to demonstrate then problem. You can download it here <a href="https://skydrive.live.com/?cid=25374d9051083633&amp;sc=documents&amp;id=25374D9051083633%21344#" rel="nofollow">https://skydrive.live.com/?cid=25374d9051083633&amp;sc=documents&amp;id=25374D9051083633%21344#</a></p> <p>Does anybody have an idea how to fix this?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload