Falls back to Light theme if loaded theme does not include some elements.

This commit is contained in:
Caeden Statia 2020-02-22 21:00:39 -08:00
parent c67c6094c8
commit 03ecbee5f9
2 changed files with 7 additions and 3 deletions

View file

@ -13,8 +13,12 @@
<!-- Load default sidebar theme, in case LoadedTheme doesn't have Sidebar properties applied. -->
<ResourceDictionary x:Name="DefaultSidebarTheme" Source="Themes/Default_Sidebar.xaml"/>
<!-- Load default theme. Currently it's Dark, not sure if you want to change it to Light. -->
<!-- Load default theme, in case the LoadedTheme does not include any visual elements for some controls.
If someone tried to load a completely empty theme, it will "fall back" to Light theme.-->
<ResourceDictionary x:Name="DefaultTheme" Source="Themes/Light.xaml"/>
<!-- Load theme to be modified via the Theme engine. -->
<ResourceDictionary x:Name="LoadedTheme" Source="Themes/Dark.xaml"/>
<!-- Load SVG icons, courtesy of lolPants. -->

View file

@ -23,7 +23,7 @@ namespace ModAssistant
private static Dictionary<string, Theme> loadedThemes = new Dictionary<string, Theme>();
private static List<string> preInstalledThemes = new List<string> { "Light", "Dark", "Light Pink" }; //These themes will always be available to use.
private static readonly int LOADEDTHEME_INDEX = 3;
private static readonly int LOADEDTHEME_INDEX = 4;
/// <summary>
/// Load all themes from local Themes subfolder and from embedded resources.