在MapItemsControl.ItemsSource中更改项属性

时间:2013-06-26 14:19:00

标签: windows-phone-7 data-binding map windows-phone-8

我有MapItemsControlPushpins和数据绑定:

 <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在集合中找到它。但是,我怎样才能改变他在地图上出现这些变化的立场,而无需重新绘制其他图钉?

0 个答案:

没有答案