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:
- <map:Pushpin Location="{Binding UserPosition}" Content="you" Visibility="{Binding UserPosition, Converter={StaticResource GeoCoordinateVisibilityConverter}}" />
Even if you change the pushpin’s visibility to Collapsed for unknown locations, you end up with an ugly exception:
System.InvalidOperationException occurred:
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:
- <map:MapLayer Visibility="{Binding UserPosition, Converter={StaticResource GeoCoordinateVisibilityConverter}}">
- <map:Pushpin Location="{Binding UserPosition}" Content="you" />
- </map:MapLayer>
A little overhead, but it works.

I’m Understanding Homepage Thank you
Why dont you try to bind to an object that implements INotifyPropertyChanged
???
I do implement INotifyPropertyChanged.
I’m using the “late-binding” term, but it’s really about setting the DataContext in the page’s Loaded event instead of at construction or declared in the XAML.