Hello community!
I am using the Metro Dark theme in an application. The color for the textbox/labels is a light gray (#BABABA). My customer now wants the text colors to be changed to "white" for having a higher contrast.
A) the theme could be changed during the runtime
B) When switching to "Metro Dark" I execute the following code:
Infragistics.Themes.ThemeManager.ApplicationTheme = new Infragistics.Themes.MetroDarkTheme() { StyleMicrosoftControls = true };
SolidColorBrush cellBackground = new SolidColorBrush(Color.FromRgb(255, 255, 255));
Style newStyle = new Style();
newStyle.TargetType = typeof(TextBox);
newStyle.Setters.Add(new Setter(TextBox.BackgroundProperty, cellBackground));
Application.Current.Resources.Add(typeof(TextBox), newStyle);
But the font color stay the same. Is there a different way to change the font color?Thank you
Hello grubarec,
Thank you for contacting Infragistics. There are several xaml files that set the Metro look and feel for each control. Knowing wich files to modify depend on the controls you wish to style. Please list the controls you are working with.
The files you need to modify are located here:
C:\Program Files (x86)\Infragistics\20xx.x\WPF\DefaultStyles
Let me know if you have any questions regarding this matter.
Hello Michael!
From the Infragistics controls, I am using
- customized TileManager, a customized theme is used based on the MetroDark theme- XamNumericrRangeSlider - XamSliderNumericThumb- XamBusyIndicator- XamNumericInput- XamDataGrid
The application is built upon our application framework. In this framework the theme is changed. After the default Metro Dark theme is loaded, the decoupled assemblies are informed that the user has changed the current theme via an event aggregator. In the assembly where the customized Tilemanager is used, I load the customized resource file for the theme manager and add the file to the Applications merged dictionaries. To add this file to the dictionaries, I need the "Styles.Shared.xaml", "Styles.WPF.xaml" and "Theme.Colors.xaml" in the visual studio project.
Upon checking the resource files, I found out, that in the Metro Dark Thema the Color Ressource with the key "Color_002" is used for the native TextBox. I have tried the following workarounds
1) Change the "color_002" in the decoupled assembly where the customized tilemanager exists. (During the decoupled theme change)2) Change the "color_002" during the runtime by finding the resource and changing the color (At the end of the theme change method)3) Replacing the style for the text box during the runtime and adding a new textbox style (At the end of the theme change method)
None of this methods has worked for me.
Have I overseen something?Thank you