I've bound the center of my MapControl
, but the map doesn't update when I'm moving.
<maps:MapControl BusinessLandmarksVisible="False"
LandmarksVisible="False"
ColorScheme="Light"
DesiredPitch="50"
PedestrianFeaturesVisible="False"
TrafficFlowVisible="False"
TransitFeaturesVisible="False"
ZoomLevel="20"
RelativePanel.AlignTopWithPanel="True"
RelativePanel.AlignBottomWithPanel="True"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
Center="{Binding CurrentGeoposition.Coordinate.Point, Mode=TwoWay}"
MapServiceToken="{Binding MapServiceToken, Mode=OneTime}"
x:Name="MapControl"/>
The only solution was to make it a two-way binding, but since it's bound to a Geoposition
, I'm flooded by errors like this:
Error: Cannot save value from target back to source. BindingExpression: Path='CurrentGeoposition.Coordinate.Point' DataItem='MyNamespace.ViewModels.GameManagerViewModel'; target element is 'Windows.UI.Xaml.Controls.Maps.MapControl' (Name='MapControl'); target property is 'Center' (type 'Geopoint').
Is there a way to make this work without all the errors but without code-behind?