I wish to allow the user to select from any of the Infragistics Themes for the application. It seems that for the MetroDark theme the Foreground property of the TextBlock is set to black and thus doesn't show up on the (almost) black background.
I can workaround this by binding the TextBlock Foreground to the Foreground property of a Label control (as in the attached example), but that rather defeats the concept of using themes.
Is this a bug, or am I missing something?
Hello peterhutchinson,
Thank you for your post.
I have been testing against the sample project that you have provided, and it appears that there is a missing implicit style for TextBlock in our MetroDark theme files that would normally set the Foreground of the TextBlock in your sample. This is unexpected, and I have asked our engineering teams to investigate further. To ensure that it receives attention, I have logged this issue in our internal tracking system with a development ID of 221126.
I have also created a support case on your behalf, which I will link this development issue to so that you can track its progress. This case has an ID of CAS-174436-X0C2Y2 and you can access it at https://es.infragistics.com/my-account/support-activity.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
I have received an update from our development teams on this matter. The implicit style for TextBlock was intentionally left out of the MetroDark theme. The reason for this is because adding an implicit style that effects every TextBlock it touches can sometimes be rather dangerous. Sometimes it will affect a TextBlock that we don't necessarily have access to, and if you don't want this style applied to that TextBlock for some reason, it can cause the need for changes that aren't so easily fixed.
For example, take a ListBox control in WPF. Inside each ListBoxItem that exists in this ListBox, there exists a ContentControl, which contains a ContentPresenter, which contains a TextBlock, which we cannot directly style. On MouseOver or selection of the ListBoxItem, the TextBlock content highlights since it is the real content of the ListBoxItem, and that is done by changing the Foreground color of the ContentControl that contains the TextBlock. Now, if we were to add an implicit style for TextBlock, then these stylings would no longer be applied, and you would end up with a result much like the attached picture. If you wanted to apply this styling to the TextBlock where the TextBlock highlights on selection, you would need to find a workaround to do so.
I would recommend that you continue to set the TextBlock's Foreground property in this case.