In Win Forms when I disable a button its image background converts to gray-level image. How can I simulate this effect in Image control using XAML codes?
you can set the opacity of image in button like below:
<Button>
<Image Source="button.png">
<Image.Style>
<Style TargetType="Image">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" />
</Trigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Button>
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