<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Image Margin="0" Grid.RowSpan="2" Source="Images/map_bg.jpg" Stretch="Fill"/>
<my:Map Height="649" HorizontalAlignment="Left" Name="map1" VerticalAlignment="Top" Width="451" LogoVisibility="Collapsed" Margin="2,0,0,0" />
</Grid>
我试图用高度和宽度变量进行升技,但只改变了地图的位置而不是拉伸整个地图。如何让WP7地图填充整个查看页面?
是否有可能使地图'填充'整个<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
属性?
谢谢!
编辑
<Grid x:Name="LayoutRoot" Background="Transparent" Opacity="0.7">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"></StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Image Margin="0" Grid.RowSpan="2" Source="Images/map_bg.jpg" Stretch="Fill"/>
<my:Map Name="map1" VerticalAlignment="Top" Width="451" LogoVisibility="Collapsed" CredentialsProvider="xxx" Margin="2,0,0,0" Height="645" />
</Grid>
</Grid>
只是为了确认:您并未尝试缩放地图,只是让控件填充可用空间? – 2012-03-29 18:55:05
是的,你是对的 – 2012-03-29 19:07:57