<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