10
Vote

About Map

description

I am binding a ObservableCollection with pushpin in ViewModel like this: this.AllePushpin.ItemsSource = mv.Threater; when I remove one item from the collection, but the corresponding item in UI still is there, it seems the collecction changes don't notify UI to change? why? I checked the source code in WP toolkit:public MapChildCollection Items { get; private set; }, it is readonly, is there anyone can help me to figure this out? thanks.the same problem here:http://stackoverflow.com/questions/13668929/binding-with-map-api-extensions-for-windows-phone-8/13911426#13911426

comments

devionics wrote Feb 14, 2013 at 8:06 PM

It seems that Databinding doesn't work for the MapItemsControl at all.

lazythruten wrote Mar 24, 2013 at 12:01 PM

please fix MapItemsControl.ItemsSourse binding ASAP. It dos not work

mehtaavi wrote Jun 13, 2013 at 8:41 AM

+1 to other comments on the thread. When I remove items from the original array that I assigned to ItemsSource, the map does not get updated.

kjschaef wrote Aug 6, 2013 at 3:06 PM

+1 - MapItemsControl is not bindable from XAML, which prevents being able to use this in an MVVM app.

ScRePt wrote Oct 3, 2013 at 1:38 PM

+1

Specially this brilliant line of code does not allow us to give the control a name:

public static readonly DependencyProperty NameProperty = DependencyProperty.Register(
        "ItemTemplate",
        typeof(string),
        typeof(MapItemsControl),
        null);
(MapItemsControl.cs)

Why a property named NameProperty be registered as "ItemTemplate" ??

Kinnara wrote Mar 4 at 1:58 PM

To fix MapItemsControl.ItemsSourse binding: in MapExtensions.cs, replace ObservableCollection with DependencyObjectCollection. Or use this fork.