Condividi tramite


Windows System Color Theme for Silverlight - Part Two

The SDK controls are now themed in the Windows system color theme style, and the Toolkit controls will be themed very soon! The updated project is available for download here.

For those of you who desire a bit more contrast in the theme, particularly for high contrast color modes, there are a few approaches you can take...

  • One quick and simple approach is to open SysColors.cs and replace the appropriate gradient brushes with solid color brushes by changing LinearGradientBrush properties to Brush properties, and, in most cases, I would recommend using ControlColor for the replacement. This will eliminate the gradients used on buttons and increase contrast a bit
  • You could take it even further and replace the use of ControlDarkDarkBrush for fonts with ControlTextBrush or WindowTextBrush, depending on where the font sits (e.g. if it sits on a background filled with ControlBrush it should use ControlTextBrush and if it sits on a background filled with WindowBrush it should use WindowTextBrush). You may also consider changing control borders from ControlDarkBrush to ControlDarkDarkBrush. These changes will increase the contrast even more
  • Another approach is to create a second rescouce dictionary for use only when in high contrast color modes that has the desired contrast level. I have created a second project that shows how this can be done. This project shows mockup Ux for an LOB demo that was used at PDC 09', and it isn't fully functional, so please focus on the theme swapping functionality which can be found in MainPage.xaml.cs and LoadResource.cs. Creating a second theme is a lot more work, but it may be the best approach for many projects

 

Screen Shots

What follows are screen shots of the PDC Ux in default and high contrast white modes and the newly themed SDK controls in various Windows default and high contrast modes...