WP7 Zoom To Pushpins Using Binding
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>
{
开发者_如何学Python 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
You can't use a binding to directly bind the view port for the map control. Take a look at this question and this question (particularly the second) for potential solutions.
精彩评论