Incorrect documentation for theme switching

1 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    30 posts
    Member since:
    Oct 2012

    Posted 11 Dec 2012 Link to this post

    Your documentation is prone to a known WPF bug:

    In my WPF 4.0 project, your code makes all my controls disappear. Apparently, there is a known bug in the MergedDictionaries.Clear() method, as pointed out here:

    This did the trick for me:
    // WORKAROUND: Application.Current.Resources.MergedDictionaries.Clear();
    for (int i = Application.Current.Resources.MergedDictionaries.Count - 1; i >= 0; --i)
Back to Top