Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6779617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:24:23+00:00 2026-05-26T16:24:23+00:00

Well i guess im missing something here.. Any way im trying to make a

  • 0

Well i guess im missing something here..

Any way im trying to make a metro style wpf theme, so i started with this:

<Color x:Key="PrimaryColor">#8CBF26</Color>
<Color x:Key="TextColor">White</Color>
<Color x:Key="BackgroundColor">Black</Color>

<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource ResourceKey=PrimaryColor}" />
<SolidColorBrush x:Key="ForgroundBrush" Color="{StaticResource ResourceKey=TextColor}" />
<SolidColorBrush x:Key="BackgroundBrush" Color="{StaticResource ResourceKey=BackgroundColor}" />

<FontFamily x:Key="FontFamily">Segoe WP, Segoe UI, Lucida Sans Unicode, Verdana</FontFamily>

<Style TargetType="{x:Type Window}">
    <Setter Property="Background" Value="{StaticResource BackgroundBrush}" />
</Style>
<Style TargetType="{x:Type Run}">
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="FontFamily" Value="{StaticResource FontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource ForgroundBrush}" />
</Style>
<Style TargetType="{x:Type TextBlock}">
    <Setter Property="FontWeight" Value="Bold" />
    <Setter Property="FontFamily" Value="{StaticResource FontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource ForgroundBrush}" />
</Style>

<Style TargetType="{x:Type Button}">
    <Setter Property="Background" Value="{StaticResource BackgroundBrush}"/>
    <Setter Property="BorderBrush" Value="{StaticResource ForgroundBrush}"/>
    <Setter Property="BorderThickness" Value="2"/>
    <Setter Property="Foreground" Value="{StaticResource ForgroundBrush}"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Padding" Value="1"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
                <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" >
                    <ContentPresenter Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" 
                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsPressed" Value="true">
                        <Setter Property="Background" Value="{StaticResource ForgroundBrush}" />
                        <Setter Property="Foreground" Value="{StaticResource BackgroundBrush}" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Well this works great for all but the trigger the Foreground property is never modified, my guess is that styled the TextBlock already so it cant override its forecolor is there any workaround for this problem??

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:24:24+00:00Added an answer on May 26, 2026 at 4:24 pm

    Edit: The TextBlock style is applied inside the ControlTemplate of the Button somehow overriding its own style. Not sure what to do about it.


    Works for me, did you set a Foreground on the Button instance? If so that would override the trigger due to precedence.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well hi, guess what, I have an IE positioning issue! This is in 8,
Running OpenSuSE 11.4 - and trying to install WWW::Mechanize::Firefox. Well I guess that I
well i have a configuration like this in the components part of my config
well, I am trying to include a header file in my project, while the
Well this one freaks me out. I used a Http Header check tool to
Ruby and StackOverflow newb here working my way through Ruby and ran into my
This question in mainly pointed at C/C++, but I guess other languages are relevant
I'm sure I'm missing something obvious, I have an area in which I intend
Upgrading my project I'm thinking here about transactions. Well, the thing is I'm not
This question is related to How to make consistent dll binaries across VS versions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.