Is there a way I can desaturate images in Buttons that are disabled? eg. ICommand.CanExecute = false
? or do I need to use separate images + Style/Triggers
I'm using a special style for this, which reduces the opacity of the image when the button gets disabled (yes, this also works if the button is bound to a command). Technically, this is not desaturation, but it looks similar and it might help you derive a solution on your own:
<Style x:Key="buttonImage">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
<Setter Property="Image.Opacity" Value="0.25"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With