Skip to content

Commit

Permalink
Add SetSystemAccent to MVVM theme service
Browse files Browse the repository at this point in the history
  • Loading branch information
pomianowski committed Jun 17, 2022
1 parent 8208ace commit b555851
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Wpf.Ui/Mvvm/Contracts/IThemeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public interface IThemeService
/// <param name="themeType">Theme type to set.</param>
bool SetTheme(ThemeType themeType);

/// <summary>
/// Sets currently used Windows OS accent.
/// </summary>
bool SetSystemAccent();

/// <summary>
/// Sets current application accent.
/// </summary>
Expand Down
8 changes: 8 additions & 0 deletions src/Wpf.Ui/Mvvm/Services/ThemeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public virtual bool SetTheme(ThemeType themeType)
return true;
}

/// <inheritdoc />
public bool SetSystemAccent()
{
Wpf.Ui.Appearance.Accent.ApplySystemAccent();

return true;
}

/// <inheritdoc />
public bool SetAccent(Color accentColor)
{
Expand Down

0 comments on commit b555851

Please sign in to comment.