其他元素内的集线器对齐

时间:2016-02-12 15:53:04

标签: xaml windows-10-universal

如何让Hub填充其余空间?不少也不多。如果Listview较长,则Hub会在屏幕下方结束。

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <controls:PageHeader Content="Main Page">
        <controls:PageHeader.SecondaryCommands>
            …
        </controls:PageHeader.SecondaryCommands>
           </controls:PageHeader>
    <Hub>
        <HubSection>
            <DataTemplate>
                <ListView>
                    …
                </ListView>
            </DataTemplate>
        </HubSection>
        <HubSection>
            …
        <HubSection>
    </Hub>
</Grid>

1 个答案:

答案 0 :(得分:0)

试试这个:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <StackPanel Grid.Row="0">
        <controls:PageHeader Content="Main Page">
            <controls:PageHeader.SecondaryCommands>
             …
            </controls:PageHeader.SecondaryCommands>
        </controls:PageHeader>
    </StackPanel>

    <Grid Grid.Row="1">
       <Hub>
           <HubSection>
               <DataTemplate>
                   <ListView>
                       …
                   </ListView>
               </DataTemplate>
           </HubSection>
           <HubSection>
            …
           <HubSection>
        </Hub>
    </Grid>
</Grid>