tags:

views:

34

answers:

0

I have a TextBox that is defined through a ControlTemplate. Because of the ControlTemplate, the TextBox is no more automatically grayed out when the IsEnabled-property is set to false.

To provide this functionality, I use the following trigger within the ControlTemplate:

<Trigger Property="IsEnabled" Value="False">                            
    <Setter Property="Foreground" Value="{x:Static SystemColors.GrayTextBrush}" />
</Trigger>

This works fine. However I have to set also the BackgroundColor but I don't have found a corresponding entry in SystemColors. Which entry is the right entry for the background of disabled controls (TextBoxes)? Is there another source than SystemColors?

I don't want to use a fixed value. e.g. setting Background="#f4f4f4", because I fear that in some environments, the disabled-background has another value and then my control looks not as it should or even is unreadable (if for example the value of the GrayTextBrush is near #f4).