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 692283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:38:05+00:00 2026-05-14T02:38:05+00:00

My WPF window has its foreground brush set to a brush from a resource

  • 0

My WPF window has its foreground brush set to a brush from a resource dictionary, and I want all text in the window to have this color, so I don’t touch the foreground brush in anything else.

Textboxes get the color
Textblocks get the color
Buttons get the color

Listboxes do not get the color, and so neither do their contents.

Is there any way to get a Listbox to behave like the other controls in this respect?

Assuming not, and that this is by design, what is the rationale?

Edit:

It seems my question is not clear enough.

I understand how to create styles and resources and apply them to ListBoxes; I’m wondering why I need to do this for certain controls when I do not need to for others — why some inherit properties and others do not — and whether there is any way to make them all inherit in the same way.

  • 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-14T02:38:05+00:00Added an answer on May 14, 2026 at 2:38 am

    The reason the ListBox and some other controls are not inheriting the Foreground property is that it is explicitly overridden with a Setter in the default style. Unfortunately even if you assign a custom style to the ListBox that doesn’t include the Foreground property setter, it will still fall back to using the default style before attempting to inherit the value of its parent.

    The order of precedence for determining the property value is:

    1. Local value
    2. Style triggers
    3. Template triggers
    4. Style setters
    5. Theme style triggers
    6. Theme style setters
    7. Property value inheritance
    8. Default value

    Since #6 is defined in the default style for the control, WPF does not attempt to determine the value of #7.

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

Sidebar

Related Questions

This one has me beat; I have a WPF window with two (important for
I have a WPF application which has a main window composed from several custom
I have a WPF Window which has a among other controls hosts a Frame.
I have WPF userControl Library project. In it I have window which has next
I want to set my WPF window's initial client size. I'm not seeing a
I have a comboBox that has a datatrigger that set its SelectedIndex based on
I have created code in WPF to let the window remember its last location
The following scenario bothers me: I have a simple WPF Window that has a
When using FxCop 1.36 for a WPF application with a single window that has
I have a Windows Forms app, that has a single ElementHost containing a WPF

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.