Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling Listbox is not changing background color in style

I have this simple style that does not change the ListBox Background when the ListBox is disabled:

<Style TargetType="ListBox" >                    
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="True">
            <Setter Property="Background" Value="Red"/>
        </Trigger>
        <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Background" Value="Orange"/>
        </Trigger>
    </Style.Triggers>
</Style>

Snoop does not help me on this one and I cannot figure a simple way without overriding templates. Anyone have a simple way to get this working? TIA.

like image 451
Klaus Nji Avatar asked Nov 04 '22 06:11

Klaus Nji


1 Answers

The only way to do this is by overriding the template

like image 64
MyKuLLSKI Avatar answered Nov 27 '22 10:11

MyKuLLSKI