I am playing around with overwriting the system colors to change the color look of my application. The new system colors are defined in a separate resource dictionary like this:
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#FF2D2D2D" />
and the file gets loaded properly. But the appearance of the controls is different if I switch the theme of the operating system (Windows 7) between "aero" and "classic". E.g. for "classic" the main part of the application appears in a dark grey color (the color of the ControlBrushKey) (see first figure). But when I start the application when "aero" is active, most of the application still has the "neutral" aero look (second figure). Why ist that? I expected the different SystemColors to be used in the same way, no matter what theme is selected.
Is changing the system colors a good idea? Or would you recommend other solutions?
You could take a look at how the default templates are defined. Download dotPeek or some other .NET decompiler and decompile the
PresentationFramework.*
assemblies inC:\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\
.You will find the decompiled BAML resources under
Resources
->PresentationFramework.*.g.resources
->themes
.