c# - 带有 WindowChrome 调整大小问题的 WPF 窗口
问题描述
将这个简单的 XAML 用于自定义窗口。它工作正常,除了在调整大小时(从左、上、左上和左下)看起来很糟糕。窗口像疯了一样闪烁。看起来不像是操作系统问题,因为微软的玻璃 Windows 应用程序可以像黄油一样平滑地调整大小。
我正在尝试自定义窗口框架,但除非我使用 WindowChrome,否则我会丢失所有调整大小、拖动等操作。
<Window x:Class="WpfApp2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp2"
WindowStyle="None"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="450" Width="600">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="1,1,1,1" />
</WindowChrome.WindowChrome>
<Border BorderBrush="Red" BorderThickness="1">
<Button Content="Test" Height="25" Width="75" />
</Border>
</Window>
解决方案
推荐阅读
- laravel - laravel 1071 指定的密钥太长;最大密钥长度为 1000 字节
- customization - Hybris 后台节点定制
- spring-cloud-contract - Spring Cloud Contract 中的负(依赖于数据库)测试用例
- javascript - 使用 Javascript 添加到另一个网站的购物车
- c++ - 扩展 Qt 插件
- sorting - 使用 lambda 表达式作为比较器在 java 流中的 sorted() 工作
- mongodb - 在 MongoDB 中查找所有并修改文档
- kubernetes - Kubernetes kubeadm 重置错误 - 无法重置
- google-cloud-platform - 如何将现有的 AI 平台管道部署升级到更新版本?
- asp.net-core - 删除 HTTPS 后,带有身份的 Asp Net Core 无法正常工作