This example illustrates how to support a custom Color Scheme in a custom control. In the current implementation, a CustomRibbonItem control uses colors defined for the default and custom Color Schemes and changes its appearance according to the current Color Scheme. The color of the RibbonControl header is overridden in these schemes as well.
All the required colors for different Color Schemes should be defined within a separate ResourceDictionary file. To use these colors in styles or templates declared within a certain ResourceDictionary, include the dictionary with colors into the MergedDictionaries collection of the target ResourceDictionary by using the ColorSchemeDictionary class and its Source property. A ResourceDictionary containing overloads of default colors should be applied to the application with the help of the GlobalColorSchemeOverrider class.