Skip to content

Instantly share code, notes, and snippets.

@jammerxd
Created December 1, 2015 23:00
Show Gist options
  • Save jammerxd/b6c2f3075d059d3e5a4d to your computer and use it in GitHub Desktop.
Save jammerxd/b6c2f3075d059d3e5a4d to your computer and use it in GitHub Desktop.
#region ChangeTheme
public void ChangeTheme(string theme)
{
App.Current.Dispatcher.Invoke(() => {
var tempTheme = ThemeManager.DetectAppStyle(Application.Current);
var appTheme = ThemeManager.GetAppTheme(theme);
ThemeManager.ChangeAppStyle(Application.Current, tempTheme.Item2, appTheme);
});
}
#endregion
#region ChangeAccent
public void ChangeAccent(string accent)
{
App.Current.Dispatcher.Invoke(() => {
var tempTheme = ThemeManager.DetectAppStyle(Application.Current);
var tempAccent = ThemeManager.GetAccent(accent);
ThemeManager.ChangeAppStyle(Application.Current, tempAccent, tempTheme.Item1);
});
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment