Just a quick question regarding the use of the following code snippet:
var locations = CurrentItems.Select(model => model.Location);
map.SetView(LocationRect.CreateLocationRect(locations));
as suggested in this answer: Zoom to show all locations in bing maps
I am retrieving a list of geocoordinate asynchrounsly and binding these to a Bing Map using an ObservableCollection; copying the resultant data over to the main UI thread using:
Deployment.Current.Dispatcher.BeginInvoke( ()=> {...} )
My problem is that, I can't reference the map control within the Dispatcher (or can I??), so how can I apply the new Pushpin locations to the map using:
map.SetView(LocationRect.CreateLocationRect(locations));
Thanks, S.