Skip to content

Instantly share code, notes, and snippets.

@punker76
Created August 11, 2020 20:48
Show Gist options
  • Save punker76/43e4c8b9cba2d5c3829a26ea6e99bd16 to your computer and use it in GitHub Desktop.
Save punker76/43e4c8b9cba2d5c3829a26ea6e99bd16 to your computer and use it in GitHub Desktop.
Use Navy color as theme for MahApps
using System.Windows;
using System.Windows.Media;
using ControlzEx.Theming;
namespace WpfApp3
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// add the light theme
var lightTheme = ThemeManager.Current.AddTheme(RuntimeThemeGenerator.Current.GenerateRuntimeTheme("Light", Colors.Navy));
// add the dark theme (not necessary if the app is only light)
ThemeManager.Current.AddTheme(RuntimeThemeGenerator.Current.GenerateRuntimeTheme("Dark", Colors.Navy));
// set the app to the added light theme
ThemeManager.Current.ChangeTheme(this, lightTheme);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment