gpt4 book ai didi

windows-phone-8.1 - Windows Phone 8.1 MapTileSource 与 MVVM 绑定(bind)

转载 作者:行者123 更新时间:2023-12-04 02:29:35 26 4
gpt4 key购买 nike

我正在尝试将 MapTileSource 的 DataSource 绑定(bind)到我的 View 模型上的属性,但我在 Maps:MapTileSource 行上收到错误 REGDB_E_CLASSNOTREG(蓝色下划线是 VS 编辑器)。我总是可以使用绑定(bind)助手来实现相同的效果(我需要在我的应用程序的 8.0 版本中)但这似乎应该只是......工作。知道有什么问题吗?

<Maps:MapControl Style="{Binding Path=MapStyle}" Center="{Binding Path=MapCenter, Mode=TwoWay}" ZoomLevel="{Binding Path=ZoomLevel, Mode=TwoWay}" MapServiceToken="">
<Maps:MapControl.TileSources>
<Maps:MapTileSource Layer="BackgroundReplacement" DataSource="{Binding Path=BaseLayerDataSource}" />
</Maps:MapControl.TileSources>
</Maps:MapControl>

我还尝试使用具有相同效果的静态数据源:
<Maps:MapControl Style="{Binding Path=MapStyle}" Center="{Binding Path=MapCenter, Mode=TwoWay}" ZoomLevel="{Binding Path=ZoomLevel, Mode=TwoWay}" MapServiceToken="">
<Maps:MapControl.TileSources>
<Maps:MapTileSource Layer="BackgroundReplacement">
<Maps:MapTileSource.DataSource>
<Maps:HttpMapTileDataSource UriFormatString="" />
</Maps:MapTileSource.DataSource>
</Maps:MapTileSource>
</Maps:MapControl.TileSources>
</Maps:MapControl>

编辑:我在 http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn632728.aspx 尝试了示例代码它工作正常,所以很明显 MapTileSource 本身并没有未注册。但这都是代码隐藏并且不使用数据绑定(bind),所以它对我没有多大用处。

编辑 2:如果我忽略错误并尝试将应用程序部署到手机模拟器,我会在 View 的 InitializeComponent() 上得到这个:
An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in HikePoint.exe but was not handled in user code

WinRT information: Cannot deserialize XBF metadata type list as '%1' was not found in namespace '%0'. [Line: 0 Position: 0]

Additional information: The text associated with this error code could not be found.



Cannot deserialize XBF metadata type list as '%1' was not found in namespace '%0'. [Line: 0 Position: 0]

If there is a handler for this exception, the program may be safely continued.

最佳答案

您的项目平台目标是什么?尝试将其更改为 x64。

Similar Question on SO

关于windows-phone-8.1 - Windows Phone 8.1 MapTileSource 与 MVVM 绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22903302/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com