Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
XamRibbonWindow (error while creating window)
posted

Hi

I just wanted to share a solution to a strange problem: an exception is thrown during creation of XamRibbonWindow on Windows XP:

An element is already added. Key in dictionary: 'RibbonBrushKeys.ScenicCaptionCloseBtnPressedBorderFillKey' Key being added: 'RibbonBrushKeys.ScenicCaptionCloseBtnPressedBorderFillKey' Error in object „System.Windows.ResourceDictionary”.

After conversations it appeared to be an issue related to currently selected windows theme which was Olive. After changing windows theme do Default or Silver it started working properly.

Parents
No Data
Reply
  • 80
    posted

    I also have the same problem with Olive theme, however the way it manifested itself was through a stack overflow before the constructor of the main window is called. My wpf application is all wired up t through XAML so I couldn't see the exact same error but when I changed it to use a static Main method thats when I can catch the exception.

Children