Late-binding, Bing Maps and Pushpins with an unknown position
It seems the Bing Maps controls for Windows Phone 7 have a little problem when you use late-binding (setting the data context in the Loaded event, for example) and you have a Pushpin with a Location set to GeoCoordinate.Unknown. For example, take this Pushpin declaration:
Even if you change the pushpin’s visibility to Collapsed for unknown locations, you end up with an ugly exception:
Message=UIElement.Arrange(finalRect) cannot be called with Infinite or NaN values in finalRect.
Well, that’s great info, right? The workaround I found was to insert that pushpin in a layer, and collapse the layer for the same criteria:
A little overhead, but it works.