Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Phone 8 Map, Databinding Map modes only works one time
    primarykey
    data
    text
    <p>I have a model with properties:</p> <pre><code> /// &lt;summary&gt; /// List of available map modes /// &lt;/summary&gt; public Array MapModes { get; private set; } /// &lt;summary&gt; /// The current cartographic mode of the map /// &lt;/summary&gt; public MapCartographicMode MapMode { get { return _mapMode; } set { if (value == _mapMode) return; _mapMode = value; OnPropertyChanged(); } } /// &lt;summary&gt; /// List of available map color modes /// &lt;/summary&gt; public Array MapColorModes { get; private set; } //The current color mode of the map public MapColorMode MapColorMode { get { return _mapColorMode; } set { if (value == _mapColorMode) return; _mapColorMode = value; OnPropertyChanged(); } } protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); } </code></pre> <p>And My XAML looks like this:</p> <pre><code> &lt;maps:Map x:Name="MainMap" Height="{Binding MapHeight}" ColorMode="{Binding MapColorMode, Converter={StaticResource MapTestConverter}}"&gt; </code></pre> <p>The properties are updated on another page.</p> <pre><code>&lt;toolkit:ListPicker Header="Map mode" ItemsSource="{Binding MapModes}" SelectedItem="{Binding Path=MapMode, Mode=TwoWay}"/&gt; &lt;toolkit:ListPicker Header="Map color mode" ItemsSource="{Binding MapColorModes}" SelectedItem="{Binding Path=MapColorMode, Mode=TwoWay}"/&gt; </code></pre> <p>Now the binding of the ListPickers works fine the value in the model always represents what was last picked here.</p> <p>The Map binding also works, it gets the initial value and also updates the first time I change a property.</p> <p>BUT that's it. after the first property change it refuses to update. (The dummy IValueConverter isn't called).</p> <p>The model still nicely raises Property changed events, and the property has the correct value in the model (manually assigning it for example at page load works flawlessly)</p> <p>Since it seems the Binding is getting "broken" I tried recreating it each time the property was updated</p> <pre><code> Binding b = new Binding("MapMode"); BindingOperations.SetBinding(MainMap, Map.CartographicModeProperty, b); </code></pre> <p>This works. I am beginning to think there is a bug or something in the wp8 map implementation. (Or I may just miss something completely obvious^^)</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