我已经绑定了我的中心MapControl
,但是当我移动时地图没有更新。
<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"/>
唯一的解决方案是使其成为双向绑定,但由于它绑定到 a Geoposition
,我被这样的错误淹没:
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').
有没有办法让这项工作没有所有错误但没有代码隐藏?