问题
I know you can do a sticky footer in css, is there any way to do it in xaml? Or to use css in xaml to do the same thing? I'm brand new to xaml, so any help would be appreciated.
回答1:
It can be done using DockPanels.
回答2:
I'd opt for a Grid as I find them easier to extend if your layout changes or you add more controls:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Label at the top"/>
<Label Grid.Row="0" Grid.Column="0" Content="Label at the bottom"/>
</Grid>
There's a decent tutorial here
来源:https://stackoverflow.com/questions/3670495/is-there-any-way-to-create-a-sticky-footer-in-xaml