Customize Colors for Simple Styles
Every control in the new version of simple styles takes a depedency on a file called Shared.xaml. This file contains a set of resources (mostly brushes…. err, actually, all brushes) that define all of colors that I use. I was pretty strict about everything in that file and not hardcoding anything. The result of this is that it’s pretty easy to make a new color scheme for simple styles.
To test this out, I took a stab at creating “glassy” version of simple styles. Here’s the updated shared.xaml. It mostly worked. Here you can see some of the original simple styles (on top) and the glassy version (below).

There are a couple of places that I ran into some problems, though. I made the “WindowBackground” color semi-transparent because I wanted TextBox and ListBox to get the glassy feel. The problem is that I use this same color as the background for the popup in Menu and ComboBox. A semi-transparent Menu is pretty tough to use. I also discovered that I had hardcoded some colors in ScrollBar. This will need to fixed in a future version.
To actually use this, you’ll probably have to make a handful of tweaks in the SimpleStyles themselves. I’ll leave that up to you. Overall, though, you could be up and running with this in 10-15 min. The whole thing took me about 45 minutes… not bad for creating a whole new look for Simple Styles.
April 22nd, 2006 at 11:35 pm
A discussion broke out with a friend of mine about his desire for a universal GUI description language. I went looking for such a creature but most seem tied to specific platforms and widget toolkits.
The most language, though not widget, independent kit seemed to be Glade, used by the open source GTK+ widget toolkit. MSFT pushes XAML. The open source Mozilla project pushes XUL. Coming from the Python programming language community, someone there tried creating an independent GUI API for that language called anygui but that died when the open source wxWindows GUI toolkit, which has its own XML GUI definition format, became popular.
Are you all there at MSFT coming up with a format that would be usable in non-MSFT contexts or is something like YAML going to be a MSFT only show?
May 1st, 2006 at 2:30 pm
Nice look. The idea of hold all resources in a dictionary is excellent.
If you link up the Resource Dictionary in your application (MyApp.xaml) the complete application have the new style.
Keep up that good work.
May 1st, 2006 at 3:23 pm
It would be nicer to have for example a few styles (for example you now have the normal one, and the ‘glossy’ one), but at the same time be able to specify the overall color of the control.
I am using your original style in one of my projects, and at one point I needed to make a button appear red, only by suggesting a background color. As it stands, if I want to do that, I have to tweak the gradient, so that it has the same feel, plus I need to specify the gradients and colors for the other states of the button (pushed, hover, etc). Just doing a ‘Background=”Red”‘ would be much easier.
By the way, do you still have the older version of Simple Styles (the one that is not simplified)?
Thanks,
Cosmin.
December 4th, 2007 at 8:57 pm
How do I implement that xaml file in my appliction