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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:22:20+00:00 2026-05-22T03:22:20+00:00

EDIT : I was able to reproduce this in a very stripped-down version of

  • 0

EDIT: I was able to reproduce this in a very stripped-down version of the application. Here is a link to the .zip file

http://www.mediafire.com/?cn918gi15uph1xe

I have the module add the view to two different regions – the status bar region along the top is where the issue occurs. The weird part is, when the same view type is added to the main region, there are no problems. The status bar region is an ItemsControl and the main region is a ContentPresenter. That is the only difference.

Please let me know if you have any insight! Thanks.

—–Original Post—–

Hello all,

I am seeing some weird behavior with WPF. I’m using .NET 4 and PRISM v4. The way we have our application structured is that the skin resource dictionaries exist in their own assembly. The modules do not reference this assembly – instead we have a skin manager class that reads from a config file which skin we want and loads the appropriate components into a merged dictionary. The merged dictionary is set in the Application resources (we clear out the Application.Resources.MergedDictionaries before we add it). The idea is that we can later switch skins at runtime if needed, and the modules don’t need to know about the skins until runtime.

Then in our xaml we are referencing styles using DynamicResource. The problem has to do with a TextBlock style defined in the skin and referenced by key, such as

<TextBlock Style="{DynamicResource someKey}" ... />

The style defines the font family, font size, and foreground. The font family and size are applied correctly (I verified this). The foreground, however, is always black. I used Snoop and WPF Inspector to see that the foreground value is “inherited” instead of coming from the style.

I also have a control that inherits from TextBlock and all it does is add some properties that determine what the text value should be (it doesn’t affect the style at all). I was able to add a property changed override for the Foreground property and found out that the style’s foreground value gets applied, and then the inherited value gets applied after that. I wasn’t able to get the .NET source debugging to work so I couldn’t figure out why/where it was being called from the second time…

Here is a link to an old, old post from a guy with the exact same problem – he did not find the answer, but instead a workaround. Unfortunately the workaround only works on the inherited control (I can’t set InheritanceBehavior for TextBlocks).

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/3501ed19-ab40-4064-81b5-e9b7b9d35b56

  • 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-22T03:22:21+00:00Added an answer on May 22, 2026 at 3:22 am

    It doesn’t explain why the problem exists, but a fix was found here:

    http://compositewpf.codeplex.com/discussions/257596

    The fix is to load the skins before creating/adding views to the shell.

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

Sidebar

Related Questions

I'm not sure what exactly to call this, but I've been able to reproduce
I haven't been able to reproduce this problem with another script, so please run
EDIT - I was able to fix this problem using code from 'Farray' with
I want to be able to edit and delete resources myself, but not allow
I want to be able to edit how users paste strings and pictures. My
I have a textarea that I'm able to edit with the jeditable plugin but
(Summary: My users need to be able to edit the structure of their dynamically
I would like the user to be able to edit the title of the
I am looking for a tool which will make able to edit parts of
I want to be able to pass fields into the edit form when a

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.