You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The example for updating a Theme resource is incomplete. #1470
The example for updating the theme resources at runtime is incomplete. Clearing mergedDictionaries breaks scenarios where other merged resources are being used, such as styles defined in a satellite assembly.
ICollection mergedDictionaries = Application.Current.Resources.MergedDictionaries;
if (mergedDictionaries != null)
{
mergedDictionaries.Clear(); <--- This clears 'all' merged entries, not just the previous theme dictionary.
mergedDictionaries.Add(new DarkTheme());
}
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: 04d29bb3-0ea9-e42a-d6d2-cf338baca362
Version Independent ID: 04d29bb3-0ea9-e42a-d6d2-cf338baca362
The theming example now removes the current theme dictionary instead of clearing all merged dictionaries. This was addressed by #3470, so I am closing this issue.
Activity
jfversluis commentedon Nov 27, 2026
The theming example now removes the current theme dictionary instead of clearing all merged dictionaries. This was addressed by #3470, so I am closing this issue.