From b55585196265e43163220c3e85b3c72b3090f96b Mon Sep 17 00:00:00 2001 From: pomianowski Date: Fri, 17 Jun 2022 19:37:49 +0200 Subject: [PATCH] Add SetSystemAccent to MVVM theme service --- src/Wpf.Ui/Mvvm/Contracts/IThemeService.cs | 5 +++++ src/Wpf.Ui/Mvvm/Services/ThemeService.cs | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Wpf.Ui/Mvvm/Contracts/IThemeService.cs b/src/Wpf.Ui/Mvvm/Contracts/IThemeService.cs index fd674016e..0daf73a28 100644 --- a/src/Wpf.Ui/Mvvm/Contracts/IThemeService.cs +++ b/src/Wpf.Ui/Mvvm/Contracts/IThemeService.cs @@ -34,6 +34,11 @@ public interface IThemeService /// Theme type to set. bool SetTheme(ThemeType themeType); + /// + /// Sets currently used Windows OS accent. + /// + bool SetSystemAccent(); + /// /// Sets current application accent. /// diff --git a/src/Wpf.Ui/Mvvm/Services/ThemeService.cs b/src/Wpf.Ui/Mvvm/Services/ThemeService.cs index 740b2210e..180293ea9 100644 --- a/src/Wpf.Ui/Mvvm/Services/ThemeService.cs +++ b/src/Wpf.Ui/Mvvm/Services/ThemeService.cs @@ -46,6 +46,14 @@ public virtual bool SetTheme(ThemeType themeType) return true; } + /// + public bool SetSystemAccent() + { + Wpf.Ui.Appearance.Accent.ApplySystemAccent(); + + return true; + } + /// public bool SetAccent(Color accentColor) {