【发布时间】:2014-03-25 10:03:15
【问题描述】:
我正在尝试在我的应用程序中将地图控件插入到 PanoramaItem Header 中:
<phone:PanoramaItem Orientation="Horizontal" Width="480">
<phone:PanoramaItem.HeaderTemplate>
<DataTemplate>
<StackPanel Height="155" Width="478" Margin="-23,0,0,0">
<!-- Map -->
<maps:Map x:Name="StationsMapOverview"
Visibility="{Binding IsDataLoaded, Converter={StaticResource BooleanToVisibilityConverter}}"
Height="115"
Margin="0,-34,0,0"
ZoomLevel="10"
Center="{Binding UserGeoCoordinate, Mode=TwoWay}"
CartographicMode="Road"
ColorMode="Light"
PedestrianFeaturesEnabled="True"
LandmarksEnabled="True"/>
</StackPanel>
</DataTemplate>
</phone:PanoramaItem.HeaderTemplate>
<!-- Stations list -->
<phone:LongListSelector x:Name="ListNearbyItems"
ItemsSource="{Binding StationItems}" Margin="0,-38,0,0" Height="480">
...
结果很好,我的地图看起来也很好。 但是在后面的代码中,我有以下错误:
name 'StationsMapOverview' does not exist in the current context
(Datacontext 由 ViewModelLocator 类设置,适用于其他页面)。
并且 'center' 选项绑定不起作用。
所以我的问题是,是否有人尝试将地图集成到 PanoramaItem Header 中?
【问题讨论】:
标签: xaml data-binding windows-phone-8 map panorama-control