我正在试图将MapTileSource的数据源绑定到我的视图模型上的属性,但是在Maps:MapTileSource行(在VS编辑器中用蓝色下划线标出)处出现错误REGDB_E_CLASSNOTREG。我可以始终使用绑定助手来实现相同的效果(在我的应用程序的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本身并没有被注销。但是,这只是一些后台代码,没有使用数据绑定,对我来说没有太大用处。
编辑2:如果我忽略这个错误,并尝试将应用程序部署到手机模拟器上,在视图的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.