0

I'm playing around with the ExpressionDark.xaml theme. I'm setting the theme in App.xaml:

<Application x:Class="WpfApplication4.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary Source="Themes/ExpressionDark.xaml"/>
    </Application.Resources>
</Application>

I looked at how they were setting the colors and styles of other controls, but am unable to produce the same result with the window.

If you like, you can see the XAML here.

Here's the XAML I'm trying:

    <Style TargetType="{x:Type Window}">
        <Setter Property="Background" Value="{DynamicResource BlackTestBrush}" />
        <Style.Triggers>
        </Style.Triggers>
    </Style>

   <SolidColorBrush x:Key="BlackTestBrush" Color="#FF000000" />

Any ideas on what I'm doing wrong here?

Thanks

ernest
  • 1,633
  • 2
  • 30
  • 48
  • Are you saying that when you include the window style above, your window(s) don't have a black background? Where are you defining the style (App.xaml?) and perhaps add the xaml for a window that is not inheriting this background brush. – Brian S Jan 30 '13 at 19:15
  • @BrianS I edited the style I linked. I added the second code block to that file. What do you mean, defining the style? I'm setting the style in app.xaml. Which works fine. All of the controls change accordingly. But the Window does not change color. – ernest Jan 30 '13 at 19:20
  • I understand now. Unfortunately, this is not possible. Take a look at [this](http://stackoverflow.com/questions/10013199/wpf-default-window-style-override) answer for a good explanation. – Brian S Jan 30 '13 at 19:37

0 Answers0