HubSection中的DataTemplate没有达到全高

met*_*ori 3 winrt-xaml windows-store-apps windows-8.1

我有以下代码:

<HubSection x:Name="modules_section" ...>
    <DataTemplate>
        <StackPanel Orientation="Vertical">
        ..................................
Run Code Online (Sandbox Code Playgroud)

如何让StackPanel占据HubSection的整个高度?

VerticalAlignment ="拉伸"不起作用.

我也尝试过使用绑定

<StackPanel Height={Binding ElementName=modules_section, Path=ActualHeight}" ...>
Run Code Online (Sandbox Code Playgroud)

但是hub部分的Actualheight似乎是0(我还尝试在代码隐藏中设置它并调试以查看值).

Row*_*haw 8

A <StackPanel>与其中的内容一样大,但一般来说,要使项目<HubSection>与该部分中的剩余空间一样高,就像设置VerticalContentAlignment该部分一样简单,即:

<HubSection VerticalContentAlignment="Stretch">
    <DataTemplate>
        <ScrollViewer HorizontalScrollMode="..." VerticalScrollMode="...">
            <StackPanel Orientation="Vertical">
                ...
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我在我的包裹<StackPanel><ScrollViewer>应对时,当有足够的数据,需要滚动使用的情况下