Skip to content

修复软件启动时Mica背景未正确应用的问题#175

Open
Jac0b-Shi wants to merge 1 commit intoJustsenger:mainfrom
Jac0b-Shi:main
Open

修复软件启动时Mica背景未正确应用的问题#175
Jac0b-Shi wants to merge 1 commit intoJustsenger:mainfrom
Jac0b-Shi:main

Conversation

@Jac0b-Shi
Copy link

这个 Pull Request 修复了#146 ,或许对#171也有缓解,更新了主窗口的外观设置,并将系统主题变更的监控逻辑从代码中移除。最重要的改进如下:

窗口外观优化:

  • src/MainWindow.xaml 中,窗口现在应当能够正确应用“Mica”背景效果,并将内容延伸到标题栏中,从而呈现出更加现代的外观。([src/MainWindow.xamlL12-R14](https://github.com/Justsenger/ExHyperV/pull/175/files#diff-b0059240fc7f4e0ce19f8ac733c919c152cf5dbbb7a9945c1a27b5fd07781564L12-R14))

主题管理重组:

  • src/MainWindow.xaml.cs 中,用于监控系统主题变化并应用“Mica”背景效果的初始化代码已被从窗口的 Loaded 事件处理程序中移除。因为“Mica”背景效果已通过 WindowBackdropType="Mica" 在 XAML 中进行配置。([src/MainWindow.xaml.csL21-L24](https://github.com/Justsenger/ExHyperV/pull/175/files#diff-94708f41adea601b0413cb27a89eb9814e2faa7a5b3816f639b6e1f6ae250458L21-L24))

Copilot AI review requested due to automatic review settings March 24, 2026 09:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 旨在解决应用启动时窗口未正确应用 Mica 背景的问题(关联 #146,可能缓解 #171),通过将主窗口的 Mica/标题栏相关配置迁移到 XAML,并移除运行时系统主题监控逻辑来简化初始化流程。

Changes:

  • MainWindow.xaml 上显式启用 WindowBackdropType="Mica",并开启 ExtendsContentIntoTitleBar="True" 以获得更现代的标题栏/背景效果。
  • MainWindow.xaml.cs 中移除 SystemThemeWatcher.Watch(...)Loaded 订阅逻辑,避免与 XAML 配置重复。

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/MainWindow.xaml 通过 XAML 属性启用 Mica 背景并将内容延伸到标题栏区域
src/MainWindow.xaml.cs 移除启动时对系统主题变化的 Watch 逻辑,减少初始化代码与重复配置

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants