Mapping and Location in Windows Phone: Listing 1

A static array of Australia's capital cities.

public class CapitalCity
{
    public string Name { get; set; }
    public GeoCoordinate Location { get; set; }
    public string ImageUrl { get; set; }
}

public CapitalCity[] cities = new[]
                                    {
                                        new CapitalCity
                                            {
                                                Name = "Sydney",
                                                Location = new GeoCoordinate(-33.8683, 151.2086),
                                                ImageUrl = "/Images/Sydney.png"
                                            },
         ... // omitted for brevity: Melbourne, Brisbane, Perth, Adelaide, Canberra and Hobart
                                            new CapitalCity
                                            {
                                                Name = "Darwin",
                                                Location = new GeoCoordinate(-12.4667, 130.8333),
                                                ImageUrl = "/Images/Darwin.png"
                                            }
                                    };
public CapitalCity[] Cities
{
    get { return cities; }
}

About the Author

Nick Randolph runs Built to Roam, a consulting company that specializes in training, mentoring and assisting other companies build mobile applications. With a heritage in rich client applications for both the desktop and a variety of mobile platforms, Nick currently presents, writes and educates on the Windows Phone platform.

comments powered by Disqus

Featured

  • VS Code 1.125 Adds Copilot Spend Meter After Billing Shock

    VS Code 1.125 adds in-editor visibility into additional Copilot budget usage as GitHub's AI-credit billing model continues to draw developer scrutiny.

  • TypeScript 7.0 RC Moves Microsoft's Go Rewrite Into the Mainline Compiler

    Microsoft's Go-based TypeScript rewrite has reached Release Candidate status, moving from a separate native-preview package into the regular TypeScript npm package while leaving some ecosystem-facing API work for TypeScript 7.1 or later.

  • Microsoft Highlights Visual Studio Live! Event Lineup and Longtime Developer Community Role

    A Microsoft MVP Blog post on Visual Studio Live!'s longevity arrives as the 2026 conference series continues with upcoming stops at Microsoft HQ, San Diego and Orlando.

  • Using Local AI to Cut Copilot Usage-Based Billing Shock

    After being gobsmacked by the new billing plan using almost all my monthly credits in one or two days, I tried pushing some Copilot-style coding work onto local models in VS Code. What I found was less "free AI" and more "pick your pain": cloud charges on one side, heavy local resource use and long waits on the other.

Subscribe on YouTube