HandyOrg / HandyControl

Contains some simple and commonly used WPF controls
https://handyorg.github.io/
MIT License
6.18k stars 1.04k forks source link

希望可以提供方法直接切换主题/主题色 #1541

Closed luluxiaoyu closed 8 months ago

luluxiaoyu commented 8 months ago

Feature request type

enhancement

Is your feature request related to a problem? Please describe

切换主题的时候需要更新资源字典如 internal void UpdateSkin(SkinType skin) { Resources.MergedDictionaries.Clear(); Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri($"pack://application:,,,/HandyControl;component/Themes/Skin{skin.ToString()}.xaml") }); Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml") }); }

Describe the solution you'd like

希望能提供类似的直接切换主题/主题色的方法 如: BrushConverter brushConverter = new BrushConverter(); ThemeManager.Current.AccentColor = (Brush)brushConverter.ConvertFromString("#0078D4");

Describe alternatives you've considered

No response

Additional context

No response