wpf - 在 WPF 中切换到全屏模式后如何保持大小?
问题描述
到目前为止我只有以下
<Grid>
<DockPanel Background="Red">
<DataGrid DockPanel.Dock="Bottom" Height="357"/>
<StackPanel Background="Gray" DockPanel.Dock="Top" />
</DockPanel>
</Grid>
我怎么能做这个?
解决方案
是不是,你想要的?默认情况下,该DockPanel.LastChildFill
属性设置为true
。因此,如果您放大窗口,则StackPanel
在您的情况下被放大。
<Grid>
<DockPanel Background="Red">
<StackPanel Background="Gray" MinHeight="75" DockPanel.Dock="Top" />
<DataGrid DockPanel.Dock="Bottom"/>
</DockPanel>
</Grid>
推荐阅读
- asp.net-identity - 为什么 authorizeview roles="admin" 使我的应用程序崩溃?
- python-3.x - 找不到命令“流浪汉”
- php - 我使用了 TwitterOAuth 库并得到了这个错误
- flutter - 当我尝试在 if-else 方法中使用动画骨架小部件时出现错误 '_debugLifecycleState != _ElementLifecycle.defunct': is not true。”
- javascript - 将 catch 块添加到 Promise 会返回待处理而不是被拒绝
- automation - 如何根据操作系统中的修改日期自动更新文本文件中的“最后更新”日期?
- javascript - 如何在单击 jQuery 时为 css 动画持续时间添加 +200ms
- vue.js - Vuejs如何将父类传递给模板中的子组件
- firebase - 有一个用于firebase的初始化文件是否有意义?
- python - 您如何匹配正则表达式中两个 [ ] 之间的所有内容?