Is there any way to create a sticky footer in xaml?

Deadly 提交于 2021-02-11 07:31:00

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!