I'm creating a Windows 8 store app that shows pushpins on Bing Maps.
To show the pushpin, I'm using a MapItemsControl that has a datatemplate of the pushpin. Now I'm trying to add the ability to tap on a pushpin and show a popup with the details of the pushpin data (location, some details etc...).
This is what I have so far:
<map:Map x:Name="map"
RightTapped="Map_RightTapped"
Loaded="Map_Loaded"
Credentials="{StaticResource BingCredentials}">
<map:Map.Children>
<map:MapItemsControl ItemTemplate="{StaticResource PushPinTemplate}"
ItemsSource="{Binding Events}"/>
</map:Map.Children>
</map:Map>
<DataTemplate x:Key="PushPinTemplate">
<map:Pushpin IsTapEnabled="True">
<map:MapLayer.Position>
<map:Location Latitude="{Binding Path=GeoLocation, Converter={StaticResource AddressToLatitudeConverter}}" Longitude="{Binding Path=GeoLocation, Converter={StaticResource AddressToLongtitudeConverter}}" />
</map:MapLayer.Position>
</map:Pushpin>
</DataTemplate>
When I run the code, I get all of my pushpin displayed, but I need to add a popup to each pushpin so it will show when i click on the pushpin.
Should I add a tapped event for the pushpin from the datatemplate? If so, what is the best way to do that?
Note the the popup is to hold within two buttons that should have their own events.