Custom ShaderEffect for QAT button images (Office2016 theme)

Ribbon for WPF Forum

Posted 6 months ago by Gergely Bacsó
Version: 17.2.0672
Avatar

Hi,

is there a way to add my own shader effect to QAT button images or customize the appearance of these buttons
when using the Office 2016 themes?

I don't want the white mask, but something else...

Thank you,
Gergely

Comments (4)

Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I believe you can disable that effect by setting the attached ImageSourceContentConverter.CanConvertToMonochrome property to false on the image.  There isn't a way to intercept that behavior otherwise with custom logic though.


Actipro Software Support

Posted 6 months ago by Gergely Bacsó
Avatar

Hi,

could you provide some sample code?
I tried to set this property everywhere but had no luck.

It seems when a button is added to the QAT above, it's ImageSourceSmall is automatically replaced with a WriteableBitmap, which is I suppose the monochrome image. I couldn't prevent this behavior. And since there is no original bitmap on the button, I can only show the monochrome one.

Thanks.

Answer - Posted 6 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you want it disabled on a specific image, you could load the image like this:

var newImage = new BitmapImage(new Uri("pack://application:,,,/SampleBrowser;component/Resources/Images/New16.png", UriKind.RelativeOrAbsolute));
ImageSourceContentConverter.SetCanConvertToMonochrome(newImage, false);

If you want it disabled on all images, you can set this in your application's Resources:

<system:Boolean x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarUseAccentBooleanKey}">False</system:Boolean>


Actipro Software Support

Posted 6 months ago by Gergely Bacsó
Avatar

Thank you!

The latest build of this product (v2018.1 build 0675) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.