edit dark theme implementation
This commit is contained in:
parent
6d281e4e44
commit
58bef7537f
2 changed files with 4 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ui:ThemesDictionary Theme="Light"/>
|
||||
<ui:ControlsDictionary />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
|
|
@ -19,13 +19,16 @@ namespace EnvyUpdate
|
|||
{
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
// Remove placeholder light theme and apply system app theme
|
||||
Wpf.Ui.Appearance.Accent.ApplySystemAccent();
|
||||
Application.Current.Resources.MergedDictionaries.RemoveAt(0);
|
||||
ThemesDictionary themedict = new ThemesDictionary();
|
||||
if (Util.IsDarkTheme())
|
||||
themedict.Theme = Wpf.Ui.Appearance.ThemeType.Dark;
|
||||
else
|
||||
themedict.Theme = Wpf.Ui.Appearance.ThemeType.Light;
|
||||
Application.Current.Resources.MergedDictionaries.Add(themedict);
|
||||
// TODO: Watch for theme changes and dynamically update
|
||||
|
||||
// Listen to notification activation
|
||||
ToastNotificationManagerCompat.OnActivated += toastArgs =>
|
||||
|
|
Reference in a new issue