home       archive       my company      currently working on       about me      my articles       contact       rss

Global Color Definitions in WPF - the core of Reuxables

ColorResources

One of the main hurdles we had to overcome was to make it easy for users to customize reuxables themes to their liking. Developers that beta tested reuxables mentioned that more often than not they'd only need to change the colors rather than the shapes of the controls.

So we opted to keep global brushes. You can read more about Global Brushes and how to use them in my article in the Expression Newsletter Feb '08 issue.

The main concept is explained in the diagram above. We have two Color objects created as named resources. A LinearGradientBrush is created by binding the GradientStop to the color resources. The control (Button in this case) uses that Brush as its background. We often use more complex structures where the base color for all controls and brushes is a single color and separate vectors create the shading via monochrome brushes - like with the Glass themes - so changing a single color (instead of two) changes the entire theme.

Reuxables comes with full source code. http://www.reuxables.com





Posted on February 28, 2008 23:18

E-mail | Permalink | Comments (0) | Trackback | Digg! | Kick it! | DZone it! | del.icio.us

Related posts

Add comment


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

July 24. 2008 19:36



Powered by the awesome BlogEngine.NET 1.3.0.0 | Designed by Nukeation Studios. www.nukeation.com

Sign in


Subscribe to Dax Pandhi's Blog by Email