How do I force <Window> to pick up the theme?

May 28, 2009 at 1:18 PM

I am very new to WPF and have an issue trying to properly set themes.

I have managed to correctly set a theme in the <Application.Resources> section of Application.xaml. I can flip back and forth between the different themes and controls such as TextBox, Expander, ListView, etc. pick up the theme. However, the Window does not seem to be picking up the colour or gradient as indicated in the samples. When I use ShinyBlue, for instance, Labels are invisible because the ForeColor of the Label is white and Window Background is also white. The Background is suppposed to be a grayish gradient.

Any ideas?

Oct 15, 2009 at 12:52 PM

Same problem here Eddie, this is my first crack at a WPF app though so I'm probably making an obvious mistake but I'll be damned if I can see what it is :(  Did you figure it out?

Oct 16, 2009 at 5:19 PM
Edited Oct 16, 2009 at 5:20 PM

No. I never got any interest in the post. My app is just a little utility app (and a learning exercise) so I kept the theme in but just ignore it. I actually think it is a problem with styling the Label control now rather than a problem styling the Background property of Window.

Here is ExpressionLight which works:

http://imgur.com/zLenR.png

Here is ShinyBlue which does not:

http://imgur.com/gLY1K.png

I also found a bunch of other issues with the Themes and Theming Library on CodePlex. I have been lazy and have not submitted them as defects to the projects. Here is my documented list:

  • Several broken themes {UX*, ShinyDarkGreen, DavesGlossyControls}
  • Difficult to grab Column splitter for resize in the ListView for Expression* themes
  • Labels are impossible to see on ShinyBlue and ShinyRed (i.e White on White)
  • Testing the ViewModel is difficult with Static methods (IThemeManagerFacade)
  • ComboBox has extra row in many themes {Expression*, ShinyRed, ShinyBlue, WhistlerBlue}.

Regards.

Oct 27, 2009 at 9:41 PM

Ditto here. Theme looks horrid because Window seems to ignore it.

I wonder... is this meant to be used only in SilverLight? If that's the case, perhaps SL doesn't actually have a Window theme and therefore it's not being picked up in the app. Maybe we just need to make a style that inherits the same Blue/Grayish background gradient and apply it to window.