WPF 应用程序在移动时缓慢/不稳定

发布于 2024-09-14 19:37:00 字数 304 浏览 3 评论 0原文

我正在创建一个相当基本的 WPF 应用程序外壳。当我使用 DragMove() 函数移动它时,应用程序可以正常移动,但似乎“猛烈”了很多。在我看来,重绘率非常低,使得应用程序看起来缓慢且无响应。

目前,除了调用 DragMove() 之外,没有任何“代码”。
XAML 由带圆角的外边框和设置为 RenderingBias="Performance" 的阴影组成。标题栏和路径上还有一个小渐变。但即使在代码中注释掉这些,仍然会使应用程序在移动时显得不稳定和缓慢。

注意我也在发布版和调试器之外运行了它。

I have a rather basic shell of a WPF app that I am creating. When I move it using the DragMove() function the app moves properly but seems to "jerk" a lot. It seems to me that the redraw rate is very low making the application look slow and unresponsive.

Currently there is no "code" besides a call to DragMove().
The XAML consists of an outer border with rounded corners and drop shadow set to RenderingBias="Performance". There is also a small gradient on the title bar and a path. But even commenting these out of the code still makes the app appear jerky and slow whilst moving.

Note I have ran this in Release and outside the debugger too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哆啦不做梦 2024-09-21 19:37:00

根据经验,尝试删除投影,您会看到更好的性能。

http://social. msdn.microsoft.com/Forums/en-US/wpf/thread/99faecec-395f-4a47-92ee-620b11c39ae7

From experience, try removing the drop shadow and you'll see much better perfomance.

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/99faecec-395f-4a47-92ee-620b11c39ae7

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文