Set dark theme as default theme
Could someone tell me how to change the default theme to dark? Right now by default the theme is light,
Hi folk,
First I change this code at MainWindow():
public MainWindow() { FirstFloor.ModernUI.Presentation.AppearanceManager.Current.ThemeSource = new Uri("pack://application:,,,/FirstFloor.ModernUI;component/Assets/ModernUI.Dark.xaml");
InitializeComponent();
}
Then I changed this code to sync Settings with Dark value in AppearanceViewModel:
public Link SelectedTheme { get { return this.selectedTheme; } set { if (this.selectedTheme == null && value == null) { if (AppearanceManager.Current.ThemeSource.LocalPath.IndexOf("Dark") > -1) this.selectedTheme = this.themes[0]; else this.selectedTheme = this.themes[1];
OnPropertyChanged("SelectedTheme");
}
else if (this.selectedTheme != value)
{
this.selectedTheme = value;
OnPropertyChanged("SelectedTheme");
// and update the actual theme
AppearanceManager.Current.ThemeSource = value.Source;
}
}
}
Good luck