Open
Conversation
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个 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))