我有MapItemsControl
,Pushpins
和数据绑定:
<toolkit:MapItemsControl>
<toolkit:MapItemsControl.ItemTemplate>
<DataTemplate>
<toolkit:Pushpin GeoCoordinate="{Binding Coordinate}"
Content="{Binding ContentPushpin}"
Background="{Binding Background}"
Tag="{Binding Tag}"
Tap="userPushpin_Tap"
>
</toolkit:Pushpin>
</DataTemplate>
</toolkit:MapItemsControl.ItemTemplate>
</toolkit:MapItemsControl>
将图钉绑定到MapItemsControl
:
ObservableCollection<MyPushpin> PushpinsCollections = ObservableCollection<MyPushpin>();
PushpinsCollections.Add(new MyPushpin()
{
Coordinate = ....,
Id = ...
//init other properties
});
NokiaMapItemsControl.ItemsSource = PushpinsCollections;
接下来,其中一个Pushpin
更改了坐标,我可以通过唯一ID在集合中找到它。但是,我怎样才能改变他在地图上出现这些变化的立场,而无需重新绘制其他图钉?