title: How to implement methods for multiple new pushpins in windows store app using Bing maps
body: <p>I'm making a Windows Store app using C# and need a bit of help with a method for when a pushpin on a map is tapped.
  So far I create a Pushpin called currentPin that I create in the XAML code. I also make a reference for the Tapped event here called pushpin_Tapped.</p>
  
  <pre><code>&lt;Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"&gt;
          &lt;bm:Map x:Name="MyMap" Credentials="{StaticResource BingMapsApiKey}" Holding="map_Held"&gt;
  
              &lt;bm:Map.Children&gt;
                  &lt;bm:Pushpin x:Name="pin" Tapped="pushpinTapped"&gt;
  
                  &lt;/bm:Pushpin&gt;
              &lt;/bm:Map.Children&gt;
          &lt;/bm:Map&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>I then place the currentPin on my current location in the OnNavigatedTo method in the MainPage.xaml.cs code. I also create the method for when this pushpin is tapped. In this method I show a dialog box for when the currentPin is tapped.</p>
  
  <pre><code>private async void pushpinTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
              {
  
                  var x = MapLayer.GetPosition(pin);
                  MessageDialog dialog = new MessageDialog("You are here " + x.Latitude + " " + x.Longitude);
                  await dialog.ShowAsync();
              }
  </code></pre>
  
  <p>I then have a method that place a new pushpin on a location when the map is held by the user, code below:</p>
  
  <pre><code>private void map_Held(object sender, HoldingRoutedEventArgs e)        
  {            
      Debug.WriteLine("You held at" + DateTime.Now.ToString() + "" + e.GetPosition(MyMap));            
      var pos = e.GetPosition(MyMap);            
      Location location;            
      MyMap.TryPixelToLocation(pos, out location);                          
      Pushpin pin = new Pushpin();            
      MyMap.Children.Add(pin);                        
      MapLayer.SetPosition(pin, location);                       
  }
  </code></pre>
  
  <p>I know it's probably staring me in the face but I'm blanking on how to get a message box or dialog box or anything to happen when each of these new pins is tapped. Could anyone shed some light please?
  Thanks,
  Aimee</p>