Tianyu Huang

Results 1 comments of Tianyu Huang

颜色主题的实现并没有那么复杂,可以使用两套平行的 ResourceDictionary 。在运行时动态修改 `Application.Current.Resources.MergedDictionaries` 即可。 关于获取系统深浅色设置,以下是一种可能的实现方案。使用事件驱动的方式可以避免轮询带来的性能下降。(来自我的私有库) ```csharp using System.Management; ... private const string RegistryKeyPath = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; private const string RegistryValueName = "AppsUseLightTheme"; private static ManagementEventWatcher _managementEventWatcher; private static bool _watcherStarted;...