WPF: Is it standard that when a menuitem is disabled the icon is not greyed out?

Found Jobi's answer helpful. Here's another way to accomplish the same thing using an Image Style and the MenuItem.Icon:

<MenuItem Header="Add ..." Command="{Binding AddCommand}" >
   <MenuItem.Icon>
      <Image Source="{StaticResource AddImage}" Style="{StaticResource EnableDisableImageStyle}"/>
   </MenuItem.Icon>
</MenuItem>

And the Style:

<Style x:Key="EnableDisableImageStyle" TargetType="{x:Type Image}">
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Opacity" Value="0.75"/>
            <Setter Property="BitmapEffect">
                <Setter.Value>
                    <BlurBitmapEffect Radius="2.0" KernelType="Gaussian"/>
                </Setter.Value>
            </Setter>
        </Trigger>
    </Style.Triggers>
</Style>

Yes it is totally up to you. Because you have provided an Icon file. So you need to create Style.Trigger on MenuItem to give disabled effect on that. Either do a Opacity =0.5 or switch image to a different .ico image while IsEnabled=False in the template

Tags:

Wpf

Icons

Command