1

我似乎无法弄清楚为什么我无法访问地图上的图钉。我使用了工具包的图钉,并尝试了一些方法来访问它,但我可以获得模型。

          <toolkit:MapItemsControl Name="mapPins">
                <toolkit:MapItemsControl.ItemTemplate>
                    <DataTemplate>
                        <toolkit:Pushpin DataContext="{Binding}" Style="{StaticResource PushPinStyle}" x:Name="trafficPushpin"
                                Background="{Binding Cue, Mode=TwoWay}"                            
                                GeoCoordinate="{Binding Location}"      
                                Tag="{Binding TrafficLocation_ui}"
                                Tap="TrafficLocationPushPin_Tap" PositionOrigin="0.5,1" />
                    </DataTemplate>
                </toolkit:MapItemsControl.ItemTemplate>
            </toolkit:MapItemsControl>


Pushpin pin = mapObj.ItemsSource.OfType<Pushpin>().FirstOrDefault(c => ((string)c.Tag).Equals(model.TrafficLocation_ui)); returns NULL. 
4

0 回答 0