Changes colors with ResourceWasher

Not Answered This post has 0 verified answers | 6 Replies | 2 Followers Thread's RSS feed.

Markus
Points 1,130
Replied On: Tue, Feb 7 2017 2:14 AM Reply

Hello,

I am using the DarkMetroTheme and want to change the default "Blue" color with some other color. Also the font color needs to be changed. I looked at the samples, but couldn't figure out how it works.

Attached is a sample project where I tried to add the ResourceWasher component in the app.xaml file in order all controls are effected.

Can you please help me to recolor my theme?

  • Post Points: 5

All Replies

Markus
Points 1,130
Replied On: Tue, Feb 7 2017 2:16 AM Reply

Attached is a screenshot, what I want to achieve.


  • Post Points: 20
Nick
Points 1,145
Infragistics Employee
Replied On: Tue, Feb 7 2017 11:39 AM Reply

Hello Markus,

 

In order to wash the controls with ResourceWasher, you have to use the theme .xaml files, rather than the ThemeManager.

You have to add them to your project from the installed file in:

C:\Program Files (x86)\Infragistics\2016.2\WPF\Themes\MetroDark

 

To illustrate this I have modified your project, please find it as an attached file.

Sincerely,
Nick
Entry-Level Software Developer

  • Post Points: 20
Markus
Points 1,130
Replied On: Wed, Feb 8 2017 6:38 AM Reply

Thanks,

it's working, but is it possible to exclude some areas to wash? Have a look at the screenshot, which areas should not be washed (red arrow).

These are:

  • Button Text Color (should stay white or grey)
  • Background of the Outlookbar items.
  • The Background at all should stay black. It seems it is also a little bit washed
  • The Border of the selected Outlookbar is still blue.


  • Post Points: 20
Nick
Points 1,145
Infragistics Employee
Replied On: Thu, Feb 9 2017 8:31 AM Reply

Hello Markus,

You can exclude elements from washing if you use an attached property IsExcludedFromWash.

In order to exclude a button foreground for example, you have to find the brush that it uses and add this property. In the same project open file Styles.Shared.xaml, add the namespace igTheme, and in the brushes section modify :

Which will keep the original button's foreground color. If you want you can also style in the application all the buttons' foreground colors to white, which will override the washer.

The resource washer does not wash two colors - black and white. If the background in a theme is washed it is not absolute black, it is a very dark gray. If you want to paint it black, you can use the same approach as I mentioned above - exclude it from wash or set the style.

Please also take a look in this topic:
http://www.infragistics.com/help/wpf/reswash-using

Sincerely,
Nick
Entry-Level Software Developer

  • Post Points: 20
Markus
Points 1,130
Replied On: Thu, Feb 9 2017 9:01 AM Reply

Thanks for the answer. It is working for the Button and the Textbox. But how to do it for the XamOutlookBar, XamDataGrid and XamDataTree? The help file doesn't include that information.

When I look into the e.g. MetroDark.xamOutlookBar.xaml file, there are no styles in there.

Actually I just want to change the LightBlue Color of the DarkMetroTheme to a different color. May be there is an easier approach?

Attached is the project where the OutlookBar and a Grid is included.

  • Post Points: 20
Nick
Points 1,145
Infragistics Employee
Replied On: Sat, Feb 11 2017 5:22 PM Reply

Hello Markus,

In order to change a single color in a theme, you have to change it in each control in your application. Using Snoop you can identify the Light Blue color is  #FF00AADE.

The ResourceDictionary for some controls (e.g. XamOutlookBar, XamDatapresenter) for the Metro Dark Theme reference to the same control's assembly. You can change that reference to a file you can modify. This file can be found in  C:\Program Files (x86)\Infragistics\2016.2\WPF\DefaultStyles folder. There is a folder for every such control. For those two controls you will need OutlookBarMetroDark.xaml and DataPresenterMetroDark.xaml files.

Note that, when you use a Default Style file, you will also need four or five additional files on which the default file depends and you can find them all in the same control's directory. Additionally you might have to reference in you project Microsoft's PresentationFramework.Luna and PresentationFramework.Aero assemblies.

When all the files are added to your project, you can identify files which are named [UsedControl]MetroDark_Brushes.xaml (e.g. DataPresenterMetroDark_Brushes.xaml, OutlookBarMetroDark_Brushes.xaml) find the #FF00AADE color and changed it. I have modify your project and replaced this color with "GoldenRod ", you can find it as an attached sample. Finally you have to replace it in Theme.Colors.xaml too. Note also, that in some files it might be set more than once, so you have to replace it at all the occurrences.

 If I can be of further assistance concerning this matter, please let me know.

Sincerely,
Nick
Entry-Level Software Developer

  • Post Points: 5
Page 1 of 1 (7 items) | RSS