How to get all the pushpins on the Map

322 views Asked by At

I cant seem to figure why I am not able to access the Pushpins that are on the map. I have used the toolkit's Pushpin, and I tried some method to access it but I can get the Models.

          <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. 
0

There are 0 answers