Skip to content

Commit 2e59a28

Browse files
committed
use less constrained property to seach for resources. #174
1 parent dd18568 commit 2e59a28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MaterialDesignThemes.Wpf/PaletteHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public virtual void SetLightDark(bool isDark)
1414
{
1515
var existingResourceDictionary = Application.Current.Resources.MergedDictionaries
1616
.Where(rd => rd.Source != null)
17-
.SingleOrDefault(rd => Regex.Match(rd.Source.AbsolutePath, @"(\/MaterialDesignThemes.Wpf;component\/Themes\/MaterialDesignTheme\.)((Light)|(Dark))").Success);
17+
.SingleOrDefault(rd => Regex.Match(rd.Source.OriginalString, @"(\/MaterialDesignThemes.Wpf;component\/Themes\/MaterialDesignTheme\.)((Light)|(Dark))").Success);
1818
if (existingResourceDictionary == null)
1919
throw new ApplicationException("Unable to find Light/Dark base theme in Application resources.");
2020

0 commit comments

Comments
 (0)