Skip to content

Commit

Permalink
Improve check for RD "equality"
Browse files Browse the repository at this point in the history
Only check RDs that have keys and only if first RD has at least as many keys as second
  • Loading branch information
batzen committed Aug 11, 2019
1 parent 58da447 commit c0c244a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/MahApps.Metro/ThemeManager/ThemeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,13 @@ private static bool AreResourceDictionarySourcesEqual(ResourceDictionary first,
return false;
}

if (first.Source.IsNull()
// If RD does not have a source, but both have keys and the first one has at least as many keys as the second,
// then compares their values.
if ((first.Source.IsNull()
|| second.Source.IsNull())
&& first.Keys.Count > 0
&& second.Keys.Count > 0
&& first.Keys.Count >= second.Keys.Count)
{
try
{
Expand Down

0 comments on commit c0c244a

Please # to comment.