Created
August 11, 2020 20:48
-
-
Save punker76/43e4c8b9cba2d5c3829a26ea6e99bd16 to your computer and use it in GitHub Desktop.
Use Navy color as theme for MahApps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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