其他元素内的集线器对齐
Hub alignment inside other element
如何让集线器填满 space 的其余部分?不多也不少。如果列表视图较长,则集线器会在屏幕下方结束。
<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>
试试这个:
<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>
如何让集线器填满 space 的其余部分?不多也不少。如果列表视图较长,则集线器会在屏幕下方结束。
<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>
试试这个:
<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>