Wpf 让bing地图在所有的五月都上映

Wpf 让bing地图在所有的五月都上映,wpf,xaml,windows-phone-7,wpf-4.0,Wpf,Xaml,Windows Phone 7,Wpf 4.0,我怎样才能让bing地图在下面的所有地方都出现呢 第一行是名字 第二行是姓氏: 第三个名字是地图 我想让bing地图从第三排一直到下一排。 地图应在第1列和第2列中 <!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions>

我怎样才能让bing地图在下面的所有地方都出现呢

第一行是名字 第二行是姓氏: 第三个名字是地图

我想让bing地图从第三排一直到下一排。 地图应在第1列和第2列中

    <!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
    <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">
        <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0">First name:</TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="0">Last name:</TextBlock>
        <TextBlock Grid.Row="0" Grid.Column="1">name</TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="1">name</TextBlock>
        <my:Map Grid.Row="2" Grid.Column="1" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
    </Grid>
</Grid>

名字:
姓氏:
名称
名称

对于要占用剩余空间的行,需要对其
高度使用
“*”
设置:

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"></RowDefinition>
        <RowDefinition Height="Auto"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="200"></ColumnDefinition>
        <ColumnDefinition Width="Auto"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <TextBlock Grid.Row="0" Grid.Column="0">First name:</TextBlock>
    <TextBlock Grid.Row="1" Grid.Column="0">Last name:</TextBlock>
    <TextBlock Grid.Row="0" Grid.Column="1">name</TextBlock>
    <TextBlock Grid.Row="1" Grid.Column="1">name</TextBlock>
    <my:Map Grid.Row="2" Grid.Column="1" Width="Auto" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
</Grid>

名字:
姓氏:
名称
名称

您可以从MSDN的页面上找到完整的详细信息。

让行和列用“*”填充容器的其余部分

还可以使用Grid.ColumnSpan=“2”,使贴图跨越两列

<Grid x:Name="LayoutRoot" Background="Transparent">
    <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">
        <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0">First name:</TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="0">Last name:</TextBlock>
        <TextBlock Grid.Row="0" Grid.Column="1">name</TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="1">name</TextBlock>
        <my:Map Grid.Row="2" Grid.ColumnSpan="2" />
    </Grid>
</Grid>

名字:
姓氏:
名称
名称

我甚至不知道这个boldGrid.ColumnSpan=“2”我学会了新的方法。Auto和*Auto之间的不同之处在于,它将为元素的大小保留一个空间,因此,如果您没有为该元素指定大小,它将容器的大小设置为该元素的默认/系统大小。如果指定了大小,它将为定义的大小保留空间。另一方面,“*”表示在解析所有其他元素容器大小后,它将占用剩余的所有可用空间。假设ControlA设置为200高度,而ControlB没有设置高度,则为高度为1000的容器指定and将为ControlA保留200高度,为ControlB保留800高度。