ImageProvider messes up icons provided explicitly for the dark theme

Bars for WPF Forum

The latest build of this product (v25.1.0) was released 1 month ago, which was before this thread was created.
Posted 8 days ago by Alex
Version: 24.1.3
Avatar

Earlier here I've been advised to explicitly turn off `ImageProvider.CanAdapt` for problematic icons -- and back then looks weren't exactly a priority for me so I just bookmarked this, assumed there will be no problem, and moved on.

Now it turned out that even if the provider fetched an alternative icon version from a separate file (e.g. Save16.Theme-MetroDark.png), it still messes with it, even though it was already manually made specifically for the dark theme. Can I somehow tell the provider to not touch ANY of the icons obtained from manually themed files -- but at the same time do adapt all the icons that come from the generic files?

Comments (1)

Posted 8 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The image provider theme variations are not intended to be used with the chromatic adaptation feature.  The documentation for the theme variations feature says:

This feature should not be used if you are making use of chromatic adaptation, since these theme variations are already designed for a specific theme and no adaptation is necessary.

While we might be able to turn off chromatic adaptation on a per-request basis when a theme-specific image is loaded, the problem is knowing when a theme-specific image is loaded.  There are multiple customization points on the ImageProvider class and we don't currently know if the image loaded is theme-specific.  Updating things to support that would require breaking changes that probably can't happen right now.

What might work out better is if you used two ImageProvider instances.  One that is for theme-specific images with ChromaticAdaptationMode set to Never.  And the other one for when you do not use theme-specific images and have chromatic adapation enabled.  One could be the default and the other you'd have to assign to appropriate image sources.  This section in the documentation tells you how to assign a non-default ImageProvider to an image source.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.