views:

14

answers:

0

I have a list of locations that I use to display pushpins on Bing Maps. I then zoom the map to show the pushpins. This is how I do it in the code behind:

        Location location1 = new Location { Latitude = -36.736108, Longitude = 174.688411 };
        Location location2 = new Location { Latitude = -36.738756, Longitude = 174.696007 };
        Location location3 = new Location { Latitude = -36.746012, Longitude = 174.693174 };

        List<GeoCoordinate> locList = new List<GeoCoordinate>
                                          {
                                              new GeoCoordinate(location1.Latitude, location1.Longitude),
                                              new GeoCoordinate(location2.Latitude, location2.Longitude),
                                              new GeoCoordinate(location3.Latitude, location3.Longitude)
                                          };

        AddPin(location1, "Job 1");
        AddPin(location2, "Job 2");
        AddPin(location3, "Job 3");

        BingMap.SetView(LocationRect.CreateLocationRect(locList));

I would like to do this using binding so I can move to a view model.

How do I do the SetView via binding?

Cheers

Steve