Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8344505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:23:46+00:00 2026-06-09T06:23:46+00:00

I am working on a Windows Phone 7 app that displays SF MUNI stops

  • 0

I am working on a Windows Phone 7 app that displays SF MUNI stops and times. I already published it, but want to add map functionality. So, I added a map, on which is displayed stops (inbound or outbound) for a specific user picked route. Here is the code I have for that, which works and displays each stop on a route:

//coords is an array of GeoCoordinates for each stop
//limit is the number of stops
GeoCoordinate [] coords=new GeoCoordinate[limit];

//pin is an array of Pushpins for each stop to add to the map
Pushpin[] pin = new Pushpin[limit];

for (int i = 0; i < limit; i++)
{
   pin[i] = new Pushpin();
}


for (int i = 0; i < limit; i++)
{
  coords[i] = new GeoCoordinate(Convert.ToDouble(latitude[inb[i]]), Convert.ToDouble(longitude[inb[i]]));//populate coords array
   pin[i].Location = coords[i];//assign coords to pushpin location for each stop
}


//wires up event handler for clicking on each stop
for (int i = 0; i < limit; i++)
{
  pin[i].MouseLeftButtonUp += new MouseButtonEventHandler(pin_MouseLeftButtonUp);
}  



//Adds a pin at each stop's geocoords for each station
for (int i = 0; i < limit; i++)
  map1.Children.Add(pin[i]);

So, the above code does place pushpins at each geocoordinate correctly. What I am totally stumped at, is how, if I press a pushpin, do I get the geocoordinate for that pushpin? In other words, when I press a pushpin, I want to capture pin[i].Location (which is a GeoCoordinate) in some sorta variable.

thanks, I hope this explains my problem.

Amanda

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:23:48+00:00Added an answer on June 9, 2026 at 6:23 am

    You should use the Tap event instead of MouseLeftButtonUp. (and make sure to remove it when leaving the page!) and you can put a reference to the GeoCoordinate in pin[i].Tag.

    Tag is a grab bag reference to whatever you want — in your case, you want to put a GeoCoordinate, but you can put whatever you want — and it exists on all UIElements.

    In your Tap event listener, you can get a reference to your GeoCoordinate like:

    pressedCoord = (GeoCoordinate)((PushPin)sender).Tag; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im working on a MVVM Windows phone app that displays weather info. When the
I am working on a Windows Phone 7 app and I want to give
I developed an app that is working fine on windows phone. The nature of
I'm working on a Windows Phone 7 app that requires some data encryption. I'm
I'm working on my windows-phone app which uses some simple data binding. I've already
I'm working on a small Windows Phone 7 Silver Light app. I simply want
I am working on a Windows Phone 7 app that talks to a 3rd
I am working on creating a Windows Phone app that will play a series
I#m working on a Windows Phone App in Visual Studio, which displays a Webbrowser
I'm working on an Windows Phone/iOS app (both native app), one feature I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.